Read legacy JBrowse 1 nested containment list JSON.
import { RemoteFile } from 'generic-filehandle'
import NCList from '@gmod/nclist'
;(async () => {
const store = new NCList({
baseUrl: `http://my.server/path/to/data/dir/`,
urlTemplate: 'volvox_genes/{refseq}/trackData.json',
readFile: url => new RemoteFile(url).readFile(),
})
for await (const feature of store.getFeatures({
refName: 'ctgA',
start: 0,
end: 50000,
})) {
console.log(
`got feature at ${feature.get('seq_id')}:${feature.get(
'start',
)}-${feature.get('end')}`,
)
}
})()
Sequence feature store using nested containment lists held in JSON files that are lazily read.
-
args
object constructor argsargs.baseUrl
string base URL for resolving relative URLsargs.urlTemplate
string Template string for the root file of each reference sequence. The reference sequence name will be interpolated into this string where{refseq}
appears.args.readFile
function function to use for reading remote from URLs.args.cacheSize
(optional, default10
)
fetch binned counts of feature coverage in the given region.
-
query
object
Returns object as:
{ bins: hist, stats: statEntry }
Fetch features in a given region. This method is an asynchronous generator yielding feature objects.