
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@jbrowse/img
Advanced tools
Static exports of JBrowse 2 rendering.
The output is currently SVG which should be loadable in Adobe Illustrator or Inkscape. The output can also be manually converted to PNG if needed.
More examples EXAMPLES.md
Note that this is not yet published to NPM but when it is you can install via
npm install -g @jbrowse/img
Then you will have a command jb2export
that can be used.
To use it now, see developer guide for details
This will show some example usages
We can call this script on local files, and it doesn't require a web browser, not even a headless webbrowser, it just runs a node script and React SSR is used to create the SVG
## generate an indexed fasta e.g. fai file
samtools faidx yourfile.fa
## generate an indexed BAM
samtools index yourfile.bam
## simple rendering of a your local files
jb2export --fasta yourfile.fa --bam yourfile.bam --loc 1:1,000,000-1,001,000
The file out.svg is created by default, use --out to customize
This example shows using remote files, e.g. with human hg19 and several tracks
Note the use of --aliases to smooth over refname differences e.g. fasta contains 1 for chr1, and bigbed contains chr1, gff contains NC_000001.10
jb2export --fasta https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz \
--aliases https://jbrowse.org/genomes/hg19/hg19_aliases.txt \
--bigbed https://hgdownload.soe.ucsc.edu/gbdb/hg19/bbi/clinvar/clinvarMain.bb \
--gffgz https://jbrowse.org/genomes/hg19/ncbi_refseq/GRCh37_latest_genomic.sort.gff.gz \
--bigwig https://jbrowse.org/genomes/hg19/reads_lr_skbr3.fa_ngmlr-0.2.3_mapped.bam.regions.bw \
--loc 1:48,683,542..48,907,531
In addition to possibly specifying custom track configuration files, sometimes specializing specifically track state is helpful. This example helps color and sort by the read group (RG) tag
jb2export --fasta data/volvox/volvox.fa \
--bam data/volvox/volvox-rg.bam color:tag:RG sort:tag:RG height:400 \
--loc ctgA:609..968
You can see that instead of adding extra dash dash --flags, it is a colon based syntax that follows a track definition.
The color and sort are specific to pileup, and height can apply to any track. More options may be described here soon
Some jbrowse track types (alignments, gene tracks, etc) will not display if zoomed too far out. Add force:true to make it render
jb2export --config data/config.json \
--loc 1:1,100,000-1,200,000 \
--assembly hg19 \
--configtracks hg00096_lowcov force:true
If you are using the fasta argument, the refseq will be named "refseq" and can be specified with the --configtracks tag. If you are using a pre-loaded config.json then you can find the trackId to pass to --configtracks in there
jb2export --fasta data/volvox/volvox.fa --configtracks refseq --loc ctgA:1-100
A config.json can be specified, and then we just refer to trackIds in this file, and extra tracks can also be supplied that are outside of the config e.g. with --bam
jb2export --config data/config.json \
--assembly hg19 \
--configtracks hg00096_highcov clinvar_cnv_hg19 \
--bam custom_bam.bam \
--loc 1:1,000,000-1,100,000
Example:
jb2export --bam file1.bam --bigwig file.bw --bam file2.bam
This will respect the order of the tracks and list file1.bam, file.bw, and file2.bam in that order. This requires us to use a custom command line parser instead of an off-the-shelf one like yargs
If you use jbrowse-web, you can select File->Export session which produces a session.json file, and then use the --session parameter. Make sure to specify the assembly also, it currently does not infer the assembly from the session
jb2export --config data/skbr3/config.json \
--session session.json \
--assembly hg19
The special flag --loc all shows the full assembly, and there are a number of custom bigwig plotting options that can help draw the bigwig genome wide
Example with logscale, manual setting of minmax score
jb2export --loc all \
--bigwig coverage.bw scaletype:log fill:false resolution:superfine height:400 color:purple minmax:1:1024 \
--assembly hg19 \
--config data/config.json
Example with linearscale, autoscore adjusted to "localsd" or mean plus/minus three standard deviations
jb2export --loc all \
--bigwig coverage.bw autoscale:localsd fill:false resolution:superfine height:400 color:purple \
--assembly hg19 \
--config data/config.json
The jbrowse CLI tool (e.g. npm install -g @jbrowse/cli) refers to "uri" paths by default, but you replace them with localPath like this
//replace this:
"vcfGzLocation": {
"uri": "volvox.dup.vcf.gz"
},
//with this:
"vcfGzLocation": {
"localPath": "volvox.dup.vcf.gz"
}
Then you can call it like above
jb2export --config data/volvox/config.json \
--assembly volvox
--configtracks volvox_sv \
--loc ctgA:1-50,000
The localPaths will be resolved relative to the file that is supplied so in
this example we would resolve data/volvox/volvox.dup.vcf.gz if "localPath":
"volvox.dup.vcf.gz" is used, and --config data/volvox/config.json
is passed
See data/volvox/config.json for a config that contains localPaths, or data/config.json for a config that just contains URLs
Specify these with a filename (local to the computer) or a http(s) URL. Can specify it multiple times e.g. --bam file1.bam --bam file2.bam
The PNG above was made with inkscape. Most methods for converting from SVG to PNG should be OK, but imagemagick may produce some somewhat weird formatting. Here are a couple methods you can try
## with inkscape
sudo apt install inkscape
inkscape --export-type png --export-filename out.png -w 2048 out.svg
## with librsvg
sudo apt install librsvg2-bin
rsvg-convert -w 2048 out.svg -o out.png
## with imagemagick
sudo apt install imagemagick
convert -size 2048x out.svg out.png
FAQs
Unknown package
The npm package @jbrowse/img receives a total of 18 weekly downloads. As such, @jbrowse/img popularity was classified as not popular.
We found that @jbrowse/img demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.