-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add script to create an igv genome config from a hub.txt file
* general cleanup
- Loading branch information
Showing
7 changed files
with
50 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Creates an IGV genome configuration json from a UCSC genark assembly hub. It might also work with other | ||
* UCSC hubs but has not been tested. | ||
* | ||
* Example use | ||
* node hubToGenomeConfig.js GCF_002006095.1 | ||
* node hubToGenomeConfig.js https://hgdownload.soe.ucsc.edu/hubs/GCF/002/006/095/GCF_002006095.1/hub.txt | ||
*/ | ||
|
||
import Hub from "../js/ucsc/ucscHub.js" | ||
import {convertToHubURL} from "../js/ucsc/ucscUtils.js" | ||
|
||
if (process.argv.length !== 3) { | ||
console.log("Usage: node hubToGenomeConfig.js <hub accession or url to hub.text>") | ||
} | ||
|
||
const hubAccensionOrURL = process.argv[2] | ||
|
||
let url | ||
if (hubAccensionOrURL.startsWith("http://") || hubAccensionOrURL.startsWith("https://")) { | ||
url = hubAccensionOrURL | ||
} else { | ||
url = convertToHubURL(hubAccensionOrURL) | ||
} | ||
|
||
if (!url) { | ||
console.error(`Could not convert input "${hubAccensionOrURL}" to genark hub url`) | ||
|
||
} | ||
|
||
const hub = await Hub.loadHub(url) | ||
|
||
const config = hub.getGenomeConfig({includeChromSizes: true}) | ||
|
||
process.stdout.write(JSON.stringify(config, null, 2)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters