markhilt / ARBitR

ARBitR: Assembly Refinement with Barcode-identity-tagged Reads
Other
10 stars 1 forks source link

graph_building error #7

Open wjj666 opened 3 years ago

wjj666 commented 3 years ago

Hi, I run arbitr.py -i pilon.fasta pilon.bam -m 75000 -s 40000 -B 20 -F 70 -Q 60 -n 3 and it leads to this error. Could you please help me? Thank you very much.

$ arbitr.py -i pilon.fasta pilon.bam -m 75000 -s 40000 -B 20 -F 70 -Q 60 -n 3
[Mon May  3 16:56:34 2021]  Starting ARBitR.
[Mon May  3 16:56:35 2021]  Collecting contigs.
[Mon May  3 16:56:35 2021]  Collecting barcodes for linkgraph.
[Mon May  3 16:56:35 2021]  Starting barcode collection. Found 262 contigs.
[Mon May  3 16:59:41 2021]  [ BARCODE COLLECTION ]  Completed: 100.0% (524 out of 524)
[Mon May  3 16:59:41 2021]  Creating link graph.
Traceback (most recent call last):
  File "/xxx/ARBitR/src/arbitr.py", line 250, in <module>
    main()
  File "/xxx/ARBitR/src/arbitr.py", line 191, in main
    backbone_graph = graph_building.main(backbone_contig_lengths, \
  File "/xxx/ARBitR/src/graph_building.py", line 507, in main
    GEMcomparison = pairwise_comparisons(GEMlist)
  File "/xxx/ARBitR/src/graph_building.py", line 390, in pairwise_comparisons
    misc.printstatus("[ BARCODE COMPARISON ]\t" + misc.reportProgress(idx+1, len(GEMlist)))
  File "/xxx/ARBitR/src/misc.py", line 29, in reportProgress
    return "Completed: {0}% ({1} out of {2})".format( str(round( (current / total) * 100, 2)), current, total)
ZeroDivisionError: division by zero
sarahshah commented 3 years ago

I also have the exact same issue! But I was running it with default settings.

markhilt commented 3 years ago

Hi, sorry about the delay.

The problem appears to be that ARBitR is unable to find any barcodes in one or more combinations of contig start and end regions. Make sure that the barcodes are in the BX tag in your bam file, e.g. by using longranger basic to process the raw reads. The barcode is thus attached as a fastq comment. Then map with e.g. BWA mem with the option -C. Other pipelines to process and map reads can also be used, as long as the barcode is found in the BX tag in the bam file.

If the bam files are correctly formatted, something else is causing ARBitR to not consider the barcodes for processing. Trying other parameters might help in that case, e.g. increasing -s and/or decreasing -q from the default of 60.

Another point not related to the issue here: -B seems a bit high but is depending on your dataset.

baokem commented 3 years ago

Hello! @sarahshah have you solved the problem? I have the same problem.

sarahshah commented 3 years ago

@baokem It turns out that my bam file was incorrectly made. The following worked for me: bwa mem -pC $mygenomeindex $myreads| samtools view -h -F4 | samtools sort -tBX -o $myfinalbamfile

baokem commented 3 years ago

thank you !@sarahshah