cortes-ciriano-lab / SComatic

A tool for detecting somatic variants in single cell data
Other
173 stars 28 forks source link

Split Bam Error 2 #35

Closed sph17 closed 1 year ago

sph17 commented 1 year ago

Hi, I am trying to run a sample through SComatic. When I run splitbam

I am getting this error:

SCOMATIC=/restricted/projectnb/findthecause/scRNAseq_mutdec/SComatic
output_dir=/restricted/projectnb/findthecause/scRNAseq_mutdec/results/pt13
sample=BUMC_LR_013_T

(SComatic)[sphao@scc4 data]$ python $SCOMATIC/scripts/SplitBam/SplitBamCellTypes.py --bam BUMC_LR_013_T_possorted_genome_bam.bam \
>         --meta pt13_annotations.tsv \
>         --id ${sample} \
>         --outdir $output_dir
[E::hts_open_format] Failed to open file "/restricted/projectnb/findthecause/scRNAseq_mutdec/results/pt13/BUMC_LR_013_T.Monocyte/Macrophage.bam" : No such file or directory
Traceback (most recent call last):
  File "/restricted/projectnb/findthecause/scRNAseq_mutdec/SComatic/scripts/SplitBam/SplitBamCellTypes.py", line 221, in <module>
    main()
  File "/restricted/projectnb/findthecause/scRNAseq_mutdec/SComatic/scripts/SplitBam/SplitBamCellTypes.py", line 213, in main
    split_bam(bam, txt, outdir,donor,tissue,max_NM,max_NH,min_MAPQ,n_trim)
  File "/restricted/projectnb/findthecause/scRNAseq_mutdec/SComatic/scripts/SplitBam/SplitBamCellTypes.py", line 49, in split_bam
    outfile_wb = pysam.AlignmentFile(outfile, "wb",template=infile)
  File "pysam/libcalignmentfile.pyx", line 742, in pysam.libcalignmentfile.AlignmentFile.__cinit__
  File "pysam/libcalignmentfile.pyx", line 915, in pysam.libcalignmentfile.AlignmentFile._open
FileNotFoundError: [Errno 2] could not open alignment file `/restricted/projectnb/findthecause/scRNAseq_mutdec/results/pt13/BUMC_LR_013_T.Monocyte/Macrophage.bam`: No such file or directory

The annotation file looks like this:

image
Francesc-Muyas commented 1 year ago

Dear user, Could you check this?

  1. Does the folder ${output_dir} exist?
  2. Cut you run this command and show the output? cut -f2 pt13_annotations.tsv | sort | uniq -c

Thanks, Fran

sph17 commented 1 year ago

Hi Fran,

Thanks for getting back to me. I checked cut -f2 pt13_annotations.tsv | sort | uniq -c and was able to locate the problem as an annotation formatted as Monocyte/Macrophage. Once I removed the /, it fixed the error. Thanks so much for your help!