jonassibbesen / rpvg

Method for inferring path posterior probabilities and abundances from pangenome graph read alignments
MIT License
45 stars 5 forks source link

mapping reads to pan-transcriptom too slow #60

Closed jkfo002 closed 5 months ago

jkfo002 commented 5 months ago

Hi,

I recently used PGGB pipeline to construct a plant graph pangenome for within 7 species. I deconstructed the graph and converted into pg graph with vg.

Then I used following pipeline to construct a spliced graph like,

# 0 pruned pg for gcsa index
$vg mod -X 256 ${pgf} > ${output}.mod.pg
$vg prune -r ${output}.mod.pg > ${output}.mod.pruned.pg
$vg index -t 52 -p -g ${output}.gcsa ${output}.mod.pruned.pg # prune only for gcsa

# 1 make a spliced graph
$vg rna -p -t 52 -s Parent \
-n S1_chr03.gff3 \
-n S2_chr03.gff3 -n S3_chr03.gff3 \
-n S4_chr03.gff3 -n S5.gff3 \
-b ${output}.spliced.gwbt -f ${output}.spliced_pantrans.fa -i ${output}.spliced.txt \
${output}.mod.pg > ${output}.mod.spliced.pg

# 2 index
spliced_pg=${output}.mod.spliced.pg
prefix=$(basename $spliced_pg .pg)
## discance .xg
$vg index -t 52 -x ${prefix}.xg ${spliced_pg}
$vg snarls -t 52 -T ${prefix}.xg > ${prefix}.snarls
$vg index -t 52 -x ${prefix}.xg -j ${prefix}.dist
## gbwt
$vg gbwt -p --num-threads 52 -r ${output}.spliced.gwbt.ri ${output}.spliced.gwbt

Then I tried to mapping reads to the spliced graph like,

# mapping reads
f1=$1
f2=$2
prefix=../test/S.chr03_PanSN.softmasked.mod
xg=${prefix}.spliced.xg
gcsa=${prefix}.pruned.gcsa
dist=${prefix}.spliced.dist
output=$(basename ${f1} _1.fq.gz)
$vg mpmap -t 52 \
-n rna -f $f1 -f $f2 \
-x ${xg} -g ${gcsa} -d ${dist} \
> ${output}.aligned.gamp

I wondered if the graph from PGGB was to complicated or other reasons to make the mapping too slow?

My vg version is version v1.55.0 "Bernolda"

jeizenga commented 5 months ago

It sounds like this issue would be more appropriate at the VG GitHub page, but the short answer is that I suspect yes. To my knowledge, nobody has had much success mapping reads to PGGB graphs with the VG mapping tools.

jkfo002 commented 5 months ago

I am grateful for your quick reply!I will try other way to construct my graph