Skip to content

Commit

Permalink
Example for resolution multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Oct 23, 2024
1 parent 920edc4 commit f460011
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/wiggle/src/BigWigAdapter/BigWigAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ export default class BigWigAdapter extends BaseFeatureDataAdapter {
return ObservableCreate<Feature>(async observer => {
statusCallback('Downloading bigwig data')
const source = this.getConf('source')
const resolutionMultiplier = this.getConf('resolutionMultiplier')
const { bigwig } = await this.setup(opts)
const feats = await bigwig.getFeatures(refName, start, end, {
...opts,
basesPerSpan: bpPerPx / resolution,
basesPerSpan: (bpPerPx / resolution) * resolutionMultiplier,
})

for (const data of feats) {
Expand Down
6 changes: 6 additions & 0 deletions plugins/wiggle/src/BigWigAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const BigWigAdapter = ConfigurationSchema(
defaultValue: '',
description: 'Used for multiwiggle',
},

resolutionMultiplier: {
type: 'number',
defaultValue: 1,
description: 'Initial resolution multiplier',
},
},
{ explicitlyTyped: true },
)
Expand Down
1 change: 1 addition & 0 deletions test_data/config_demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@
"category": ["SKBR3"],
"adapter": {
"type": "BigWigAdapter",
"resolutionMultiplier": 10,
"bigWigLocation": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/reads_lr_skbr3.fa_ngmlr-0.2.3_mapped.bam.regions.bw",
"locationType": "UriLocation"
Expand Down

0 comments on commit f460011

Please sign in to comment.