sridnona / cb_sniffer

mutation(barcode) caller for 10x single cell data
GNU General Public License v3.0
44 stars 16 forks source link

Troubleshooting - variants file issues #16

Closed FredoJones closed 2 years ago

FredoJones commented 2 years ago

Hey! Here is how I launch cb_sniffer:

#!/bin/bash

python PATH/cb_sniffer-master/cb_sniffer.py \
PATH/possorted_genome_bam.bam \
PATH/variants2.txt \
PATH/barcodes_raw.tsv \
SC001

my variants file is a .txt file tab delimited that looks like the following:


chrm    start   stop    ref var gene_name   trv_type
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation
7   140753336   140753336   A   T   BRAF    Missense_Mutation 
... 

When I launch i get the following error:


9 5073770 Missense_Mutation JAK2 0
Traceback (most recent call last):
  File "PATH/cb_sniffer.py", line 391, in <module>
    barcode_counts = x.count_barcodes(bam_file, bars, x.classify(), mq, bq)
  File "PATH/cb_sniffer.py", line 85, in count_barcodes
    for pileupcolumn in pile.pileup(reference=self.chrm, start=self.start - 1, end=self.start,
  File "pysam/libcalignmentfile.pyx", line 1335, in pysam.libcalignmentfile.AlignmentFile.pileup
  File "pysam/libchtslib.pyx", line 685, in pysam.libchtslib.HTSFile.parse_region
ValueError: invalid contig `9`

What am I doing wrong? Thank you in advance

FredoJones commented 2 years ago

I am currently using a pysam version pysam 0.19.0 pypi_0 pypi loaded with pip command

sridnona commented 2 years ago

Glad you figured out ?!

FredoJones commented 2 years ago

Yes, I fixed my Chrm line. I appended the “chr” to every line. This was the only way to make it work. I didn’t find this in your wiki, I think you should add it if you think is appropriate. Many thanks Alfredo

Il giorno ven 6 mag 2022 alle 22:17 sridnona @.***> ha scritto:

Glad you figured out ?!

— Reply to this email directly, view it on GitHub https://github.com/sridnona/cb_sniffer/issues/16#issuecomment-1119978958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT2D3Z5H32MADDBIOKXA73TVIV43ZANCNFSM5VIGIMKQ . You are receiving this because you modified the open/close state.Message ID: @.***>

FredoJones commented 1 year ago

Hey I'm sorry to bother again. I've had to use this tool again lately. Despite adding the "chr" to my chromosomal number, as this is likely the contig indexing in the bam file, I still get invalid contig errors (the last one for chr23), just a couple of lines down my variant file. it seems the script terminates if it encounters contigs not present in the BAM file instead of skipping to the next line of variant list. Is this a possible scenario in your opinion?