nedialkova-lab / mim-tRNAseq

Modification-induced misincorporation tRNA sequencing
GNU General Public License v3.0
19 stars 14 forks source link

Fail to read the header from unpaired_mult files #71

Open Xinkai-Wu opened 2 months ago

Xinkai-Wu commented 2 months ago

Hello, mim-tRNAseq maintainer,

When performing alignment with mim-seq, I encountered an error where the SAM file header could not be read. Strangely, this issue only occurs with some of the files. I'm not sure if you know how to resolve this problem. Thank you very much.

Best, Xinkai

Error message: 2024-09-05 12:52:10,013 [INFO ] **** test1.fastq.gz **** 2024-09-05 12:52:10,015 [INFO ] Aligning reads to Hsap_tRNAgenome... 2024-09-05 12:52:20,904 [INFO ] Compressing SAM files, sorting, and computing mapping stats... [bam_sort_core] merging from 0 files and 30 in-memory blocks... 2024-09-05 12:52:23,639 [INFO ] **** test2.fastq.gz **** 2024-09-05 12:52:23,642 [INFO ] Aligning reads to Hsap_tRNAgenome... 2024-09-05 12:52:40,688 [INFO ] Compressing SAM files, sorting, and computing mapping stats... [bam_sort_core] merging from 0 files and 30 in-memory blocks... [E::sam_hdr_create] Invalid header line: must start with @HD/@SQ/@RG/@PG/@CO Traceback (most recent call last): File "/tscc/nfs/home/xinkaiwu8/software/Miniforge/miniforge/envs/mimseq/bin/mimseq", line 10, in <module> sys.exit(main()) File "/tscc/nfs/home/xinkaiwu8/software/Miniforge/miniforge/envs/mimseq/lib/python3.7/site-packages/mimseq/mimseq.py", line 421, in main args.misinc_thresh, args.mito, args.plastid, args.pretrnas, args.local_mod, args.p_adj, args.crosstalks, args.sampledata) File "/tscc/nfs/home/xinkaiwu8/software/Miniforge/miniforge/envs/mimseq/lib/python3.7/site-packages/mimseq/mimseq.py", line 135, in mimseq snp_index_path, snp_index_name, out, threads, snp_tolerance, keep_temp, remap_mismatches, map_round, remap) File "/tscc/nfs/home/xinkaiwu8/software/Miniforge/miniforge/envs/mimseq/lib/python3.7/site-packages/mimseq/tRNAmap.py", line 52, in mainAlign unique_bam, librarySize, alignstats = mapReads(fq, genome_index_path, genome_index_name, snp_index_path, snp_index_name, threads, out_dir, snp_tolerance, keep_temp, mismatches, remap) File "/tscc/nfs/home/xinkaiwu8/software/Miniforge/miniforge/envs/mimseq/lib/python3.7/site-packages/mimseq/tRNAmap.py", line 128, in mapReads multi_count = int(pysam.view("-@",str(threads),"-F", "0x904", "-c", out_dir + file.name).strip()) File "/tscc/nfs/home/xinkaiwu8/software/Miniforge/miniforge/envs/mimseq/lib/python3.7/site-packages/pysam/utils.py", line 89, in __call__ stderr)) pysam.utils.SamtoolsError: 'samtools returned with error 1: stdout=, stderr=[main_samview] fail to read the header from "test2.unpaired_mult".\n'

drewjbeh commented 3 weeks ago

Hi there, I am not sure why this is happening. Could you try manually look at the bam file in question to see if there is a header?