Skip to content

Commit

Permalink
Merge pull request #371 from vgteam/no-gam-chunk
Browse files Browse the repository at this point in the history
Add a no-GAM chunk to the Cactus example
  • Loading branch information
adamnovak authored Nov 28, 2023
2 parents abe40a3 + 21a0ddf commit 26266cc
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ For example:

```
cd exampleData/
../scripts/prepare_chunk.sh -x mygraph.xg -h mygraph.gbwt -r chr1:1-100 -d 'Region A' -o chunk-chr1-1-100 -g mygam1.gam -g mygam2.gam >> mychunks.bed
../scripts/prepare_chunk.sh -x mygraph.xg -h mygraph.gbwt -r chr1:101-200 -d 'Region B' -o chunk-chr1-100-200 -g mygam1.gam -g mygam2.gam >> mychunks.bed
../scripts/prepare_chunks.sh -x mygraph.xg -h mygraph.gbwt -r chr1:1-100 -d 'Region A' -o chunk-chr1-1-100 -g mygam1.gam -g mygam2.gam >> mychunks.bed
../scripts/prepare_chunks.sh -x mygraph.xg -h mygraph.gbwt -r chr1:101-200 -d 'Region B' -o chunk-chr1-100-200 -g mygam1.gam -g mygam2.gam >> mychunks.bed
```

The BED file linking to the chunks has two additional nonstandard columns:
Expand All @@ -168,7 +168,7 @@ You can use `prepare_chunks.sh` script to generate this additional `nodeColors.t

```
cd exampleData/
../scripts/prepare_chunk.sh -x mygraph.xg -h mygraph.gbwt -r chr1:1-100 -d 'Region A' -o chunk-chr1-1-100 -g mygam1.gam -g mygam2.gam -n "1 2 3" >> mychunks.bed
../scripts/prepare_chunks.sh -x mygraph.xg -h mygraph.gbwt -r chr1:1-100 -d 'Region A' -o chunk-chr1-1-100 -g mygam1.gam -g mygam2.gam -n "1 2 3" >> mychunks.bed
```

Adding this additional `n` flag will allow a string space delimited input of node names which will be outputted to `nodeColors.tsv`.
Expand Down
5 changes: 3 additions & 2 deletions exampleData/cactus.bed
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ref 10 100 this is a test region
ref 1000 2000 another region with a very long description to see how it will be displayed
ref 2000 3000 pre-fecthed region chunk-ref-2000-3000
ref 4000 4500 pre-fecthed region but the chunk is missing test_prechunk_missing
ref 2000 3000 pre-fetched region chunk-ref-2000-3000
ref 4000 4500 pre-fetched region but the chunk is missing test_prechunk_missing
ref 482 2450 region without read tracks chunk-cactus-no-reads
128 changes: 128 additions & 0 deletions exampleData/chunk-cactus-no-reads/chunk.vg
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
VG�
d
`TTTAGAAATCTCTTCTAGTTTCATTTTCCTTTTTTTTTTTTTTTTTTTGAGCCACAGTCTCACTGTCACCCAGGCTGGAGTGCCGTGGTATGATCT
d
`TGGCTCACTGCAACCTCCACCTCCCGGGCTGAAGTGATTCTCCTGCCTTAGCCACCTGAGTAGCTGGGATTACAGGTGTCCACCACCATGACCGGC
d
`TAATTTCTGTATTTTTAGTAGAGATGGGGTTTCACCATGTTGGCCAGGCTGGTTTCGAACTCCTGACCTCCAGTGATCTGCCCACCTTGGCCTCCC
d
`AAAGTGCTGGGATTACAGGCGTGAGCCACCATGCCCAGGTTTCAAGTTTCCTTTTCATTTCTAATACCTGCCTCAGAATTTCCTCCCCAATGTTCC

d
`ACTCCAACATTTGAGAACTGCCCAAGGACTATTCTGACTTTAAGTCACATAATCGATCCCAAGCACTCTCCTTCCATTGAAGGGTCTGACTCTCTG
d
`CCTTTGTGAACACAGGGTTTTAGAGAAGTAAACTTAGGGAAACCAGCTATTCTCTTGAGGCCAAGCCACTCTGTGCTTCCAGCCCTAAGCCAACAA
d
`CAGCCTGAATAGAAAGAATAGGGCTGATAAATAATGAATCAGCATCTTGCTCAATTGGTGGCGTTTAAATGGTTTTAAAATCTTCTCAGGTGAAAA
d
`ATTACCATAATTTTGTGCTCATGGCAGATTTCCAAGGGAGACTTCAAGCAGAAAATCTTTAAGGGACCCTTGCATAGCCAGAAGTCCTTTTCAGGC
d
`TGATGTACATAAAATATTTAGTAGCCAGG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GGTGATCC
g
cGCCCTGAGGCTGAGGCAGGAGAATCATTTAAACCCAGGAGGCGGAGGTTGCAGTGAGCCAAGACTGGGCCACTGCACTCCAGCCTGCTAAGTGACAGAG  

    �
GI262359905[78741]
 cc(
 cc(
 cc(
 cc(
 cc(
 (
 (
 ``(
 ``( 
 ``(

 ``( 
 ``( 
 ``(
 ``(
 ``(
 ``(
 ``(
 ``(

``(
 ``(
 ``(
 ``(�
GI528476558[482]
``(
``(
 ``(

``(
 ``(
 ``(
``(
``(
``( 
``(

``( 
``( 
``(
``(
``(
(
(
(
cc(
cc(
cc(
cc(
cc(�
ref
``(
``(
 ``(

``(
 ``(
 ``(
``(
``(
``( 
``(

``( 
``( 
``(
``(
``(
(
(
cc(
cc(
cc(
cc(
cc(
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions exampleData/chunk-cactus-no-reads/chunk_contents.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
chunk.vg
chunk_0_ref_482_2449.annotate.txt
regions.tsv
tracks.json
1 change: 1 addition & 0 deletions exampleData/chunk-cactus-no-reads/regions.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref 482 2450 chunk-cactus-no-reads/chunk_0_ref_482_2449.vg chunk-cactus-no-reads/chunk_0_ref_482_2449.annotate.txt
11 changes: 11 additions & 0 deletions exampleData/chunk-cactus-no-reads/tracks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"trackFile": "exampleData/cactus.vg.xg",
"trackType": "graph",
"trackColorSettings": {
"mainPalette": "#000000",
"auxPalette": "greys",
"colorReadsByMappingQuality": false
}
}
]
5 changes: 2 additions & 3 deletions scripts/prepare_chunks.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -e
set -x

function usage() {
echo >&2 "${0}: Extract graph and read chunks for a region, producing a referencing line for a BED file on standard output"
Expand Down Expand Up @@ -71,8 +70,8 @@ vg_chunk_params=(-x $GRAPH_FILE -g -c 20 -p $REGION -T -b $OUTDIR/chunk -E $OUTD
# construct track JSON for graph file
# get path relative to directory above the scripts directory
GRAPH_FILE_PATH=$(realpath --relative-to $(dirname ${BASH_SOURCE[0]})/../ $GRAPH_FILE)
echo ${GRAPH_FILE_PATH}
GRAPH_PALETTE="$(cat " $(dirname ${BASH_SOURCE[0]})/../src/config.json" | jq '.defaultGraphColorPalette')"
echo >&2 "Graph file: ${GRAPH_FILE_PATH}"
GRAPH_PALETTE="$(cat "$(dirname ${BASH_SOURCE[0]})/../src/config.json" | jq '.defaultGraphColorPalette')"
jq -n --arg trackFile "${GRAPH_FILE_PATH}" --arg trackType "graph" --argjson trackColorSettings "$GRAPH_PALETTE" '$ARGS.named' >> $OUTDIR/temp.json

# construct track JSON for haplotype file, if provided
Expand Down

0 comments on commit 26266cc

Please sign in to comment.