UCSC-LoweLab / tRAX

tRNA Analysis of eXpression
GNU General Public License v3.0
9 stars 5 forks source link

Error at step3 #21

Closed Leoyiosin closed 1 year ago

Leoyiosin commented 1 year ago

Dear developers: I get a problem when I'm running processsamples.py script at Step3, and can't find a solution. Error information recorded in the mapstats.txt shows below. Could you tell me how to solve this problem? Your guidance will be very helpful to a beginner. Best wishes Yaxin Liu 2022/10/04

(ERR): bowtie2-align exited with value 137
Traceback (most recent call last):
  File "/media/data1/data/LYX/bash/choosemappings.py", line 305, in <module>
    getbesttrnamappings(args.trnaname, progname = args.progname, fqname = args.fqname, libname = args.expname, setcountfile = args.trnasetcounts, minnontrnasize = args.minnontrnasize)
  File "/media/data1/data/LYX/bash/choosemappings.py", line 86, in getbesttrnamappings
    newheader["PG"].append({"PN" :progname, "ID": progname,"VN":gitversion})
KeyError: 'PG'

Hi, Today I rerun the pepline from step1, but error still happens at step3. 2022/10/05

bowtie2  -x dbname-tRNAgenome -k 100 --very-sensitive --ignore-quals --np 5 --reorder -p 1 -U sample8_trimmed.fastq.gz | /media/data1/data/LYX/bash/choosemappings.py dbname-trnatable.txt --progname=TRAX --fqname=sample8_trimmed.fastq.gz --expname=/media/data1/data/LYX/lyx_tsRNAseq/single5_samplefile.txt --minnontrnasize=20 | samtools sort -T /tmp/WT_cytokines2temp - -o ./WT_cytokines2.bam
Could not map sample4_trimmed.fastq.gz, check mapstats file
Exiting...
Killed
(ERR): bowtie2-align exited with value 137
Traceback (most recent call last):
  File "/media/data1/data/LYX/bash/choosemappings.py", line 305, in <module>
    getbesttrnamappings(args.trnaname, progname = args.progname, fqname = args.fqname, libname = args.expname, setcountfile = args.trnasetcounts, minnontrnasize = args.minnontrnasize)
  File "/media/data1/data/LYX/bash/choosemappings.py", line 70, in getbesttrnamappings
    bamfile = pysam.Samfile("-", "r" )
  File "pysam/libcalignmentfile.pyx", line 741, in pysam.libcalignmentfile.AlignmentFile.__cinit__
  File "pysam/libcalignmentfile.pyx", line 990, in pysam.libcalignmentfile.AlignmentFile._open
ValueError: file has no sequences defined (mode='r') - is it SAM/BAM format? Consider opening with check_sq=False

Hi, I notice there is a similar issue issue#17 got by someone else, but differently, I don't find something wrong when create the reference database. The database files and log look like this.

image

_Command: /home/star-x/.conda/envs/trax_env/bin/bowtie2-build-s --wrapper basic-0 dbname-tRNAgenome.fa dbname-tRNAgenome Settings: Output files: "dbname-tRNAgenome..bt2l" Line rate: 7 (line is 128 bytes) Lines per side: 1 (side is 128 bytes) Offset rate: 4 (one in 16) FTable chars: 10 Strings: packed Max bucket size: default Max bucket size, sqrt multiplier: default Max bucket size, len divisor: 4 Difference-cover sample period: 1024 Endianness: little Actual local endianness: little Sanity checking: disabled Assertions: disabled Random seed: 0 Sizeofs: void:8, int:4, long:8, size_t:8 Input files DNA, FASTA: dbname-tRNAgenome.fa Building a LARGE index Reading reference sizes Time reading reference sizes: 00:00:17 Calculating joined length Writing header Reserving space for joined string Joining reference sequences Time to join reference sequences: 00:00:13 bmax according to bmaxDivN setting: 663200079 Using parameters --bmax 497400060 --dcv 1024 Doing ahead-of-time memory usage test Passed! Constructing with these parameters: --bmax 497400060 --dcv 1024 --packed Constructing suffix-array element generator Building DifferenceCoverSample Building sPrime Building sPrimeOrder V-Sorting samples V-Sorting samples time: 00:01:21 Allocating rank array Ranking v-sort output Ranking v-sort output time: 00:00:20 Invoking Larsson-Sadakane on ranks Invoking Larsson-Sadakane on ranks time: 00:00:40 Sanity-checking and returning Building samples Reserving space for 12 sample suffixes Generating random suffixes QSorting 12 sample offsets, eliminating duplicates QSorting sample offsets, eliminating duplicates time: 00:00:00 Multikey QSorting 12 samples (Using difference cover) Multikey QSorting samples time: 00:00:00 Calculating bucket sizes Splitting and merging Splitting and merging time: 00:00:00 Avg bucket size: 2.6528e+09 (target: 497400059) Converting suffix-array elements to index image Allocating ftab, absorbFtab Entering Ebwt loop Getting block 1 of 1 No samples; assembling all-inclusive block Sorting block of length 2652800316 for bucket 1 (Using difference cover) Sorting block time: 00:34:46 Returning block of 2652800317 for bucket 1 Exited Ebwt loop fchr[A]: 0 fchr[C]: 773283478 fchr[G]: 1325935773 fchr[T]: 1878631047 fchr[$]: 2652800316 Exiting Ebwt::buildToDisk() Returning from initFromVector Wrote 892683251 bytes to primary EBWT file: dbname-tRNAgenome.1.bt2l Wrote 1326400164 bytes to secondary EBWT file: dbname-tRNAgenome.2.bt2l Re-opening _in1 and _in2 as input streams Returning from Ebwt constructor Headers: len: 2652800316 bwtLen: 2652800317 sz: 663200079 bwtSz: 663200080 lineRate: 7 offRate: 4 offMask: 0xfffffffffffffff0 ftabChars: 10 eftabLen: 20 eftabSz: 160 ftabLen: 1048577 ftabSz: 8388616 offsLen: 165800020 offsSz: 1326400160 lineSz: 128 sideSz: 128 sideBwtSz: 96 sideBwtLen: 384 numSides: 6908335 numLines: 6908335 ebwtTotLen: 884266880 ebwtTotSz: 884266880 color: 0 reverse: 0 Total time for call to driver() for forward index: 00:43:06 Reading reference sizes Time reading reference sizes: 00:00:15 Calculating joined length Writing header Reserving space for joined string Joining reference sequences Time to join reference sequences: 00:00:13 Time to reverse reference sequence: 00:00:09 bmax according to bmaxDivN setting: 663200079 Using parameters --bmax 497400060 --dcv 1024 Doing ahead-of-time memory usage test Passed! Constructing with these parameters: --bmax 497400060 --dcv 1024 --packed Constructing suffix-array element generator Building DifferenceCoverSample Building sPrime Building sPrimeOrder V-Sorting samples V-Sorting samples time: 00:01:20 Allocating rank array Ranking v-sort output Ranking v-sort output time: 00:00:21 Invoking Larsson-Sadakane on ranks Invoking Larsson-Sadakane on ranks time: 00:00:41 Sanity-checking and returning Building samples Reserving space for 12 sample suffixes Generating random suffixes QSorting 12 sample offsets, eliminating duplicates QSorting sample offsets, eliminating duplicates time: 00:00:00 Multikey QSorting 12 samples (Using difference cover) Multikey QSorting samples time: 00:00:00 Calculating bucket sizes Splitting and merging Splitting and merging time: 00:00:00 Avg bucket size: 2.6528e+09 (target: 497400059) Converting suffix-array elements to index image Allocating ftab, absorbFtab Entering Ebwt loop Getting block 1 of 1 No samples; assembling all-inclusive block Sorting block of length 2652800316 for bucket 1 (Using difference cover) Sorting block time: 00:34:49 Returning block of 2652800317 for bucket 1 Exited Ebwt loop fchr[A]: 0 fchr[C]: 773283478 fchr[G]: 1325935773 fchr[T]: 1878631047 fchr[$]: 2652800316 Exiting Ebwt::buildToDisk() Returning from initFromVector Wrote 892683251 bytes to primary EBWT file: dbname-tRNAgenome.rev.1.bt2l Wrote 1326400164 bytes to secondary EBWT file: dbname-tRNAgenome.rev.2.bt2l Re-opening _in1 and in2 as input streams Returning from Ebwt constructor Headers: len: 2652800316 bwtLen: 2652800317 sz: 663200079 bwtSz: 663200080 lineRate: 7 offRate: 4 offMask: 0xfffffffffffffff0 ftabChars: 10 eftabLen: 20 eftabSz: 160 ftabLen: 1048577 ftabSz: 8388616 offsLen: 165800020 offsSz: 1326400160 lineSz: 128 sideSz: 128 sideBwtSz: 96 sideBwtLen: 384 numSides: 6908335 numLines: 6908335 ebwtTotLen: 884266880 ebwtTotSz: 884266880 color: 0 reverse: 1 Total time for backward call to driver() for mirror index: 00:43:18

andrewdholmes commented 1 year ago

Alright while I'm not sure how you could have gotten that error (perhaps something unusual with your bowtie2?) but added a fix so you shouldn't get that issue now.

On Tue, Oct 4, 2022 at 6:15 AM Yaxin Liu @.***> wrote:

Dear developers: I get a problem when I'm running processsamples.py script at Step3, and can't find a solution. Error information recorded in the mapstats.txt shows below. Could you tell me how to solve this problem? Your guidance will be very helpful to a beginner. Best wishes Yaxin Liu

(ERR): bowtie2-align exited with value 137 Traceback (most recent call last): File "/media/data1/data/LYX/bash/choosemappings.py", line 305, in getbesttrnamappings(args.trnaname, progname = args.progname, fqname = args.fqname, libname = args.expname, setcountfile = args.trnasetcounts, minnontrnasize = args.minnontrnasize) File "/media/data1/data/LYX/bash/choosemappings.py", line 86, in getbesttrnamappings newheader["PG"].append({"PN" :progname, "ID": progname,"VN":gitversion}) KeyError: 'PG'

— Reply to this email directly, view it on GitHub https://github.com/UCSC-LoweLab/tRAX/issues/21, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHEMLV6JQH6NW6QOOSEKWTWBQUXPANCNFSM6AAAAAAQ4SB2HU . You are receiving this because you are subscribed to this thread.Message ID: @.***>