FenyoLab / L1EM

Estimate locus specific human LINE-1 expression.
Other
31 stars 9 forks source link

Error in L1EM step4: UnboundLocalError: local variable 'new_read_id1' referenced before assignment #5

Closed fansalon closed 3 years ago

fansalon commented 3 years ago

Hi, thanks for implementing L1EM!

I have installed L1EM as indicated in the manual and built the human reference as indicated.

I next tried to use the pipeline on one stranded PE RNA-seq sample but at STEP-4 an error rose (pasted below). The pipeline nevertheless continues its run (I guess this is a consequence of the bash resilience, introducing set -e might solve this[?]), and all the txt output files are empty.

I was wondering whether I am somehow mis-using L1EM and what's going on.

ERROR: STEP 4: G(R) matrix construction Traceback (most recent call last): File "/home/fansalon/Software/L1EM//L1EM/G_of_R.py", line 308, in main() File "/home/fansalon/Software/L1EM//L1EM/G_of_R.py", line 294, in main if not (new_read_id1 or new_read_id2): UnboundLocalError: local variable 'new_read_id1' referenced before assignment

COMMAND:

source activate L1EM
genome=~/Software/L1EM/hg38/hg38.fa
# map reads to hg38
bwa mem -v 1 -t $cpu $genome $reads1 $reads2 > ${name}.sam
# convert sam to bam and sort it
samtools view -@ $cpu -b ${name}.sam -o ${name}.bam
samtools sort -@ $cpu ${name}.bam -o ${name}.sorted.bam
samtools index -@ $cpu ${name}.sorted.bam
## Run L1EM
bash ~/Software/L1EM/run_L1EM.sh ${PWD}/${name}.sorted.bam ~/Software/L1EM/ $genome

Thanks, Federico

wmckerrow commented 3 years ago

I think this error occurs when one of the bam files in split_fqs has no aligned reads. Can you check to see if that is the case? For me, this has occurred when the alignment step gets killed due to using too much memory. Were there any errors thrown in step 3? I'm testing a change to run_L1EM.sh that will require less memory at that point. If it works, I'll upload it – it might help you with this error.

wmckerrow commented 3 years ago

If the issue is related to memory. I just uploaded a script (run_L1EM_withlessmemory.sh) that should help.

fansalon commented 3 years ago

Hi,

thanks for this!

I can confirm that increasing the job memory, L1EM analysis was successfully completed. Not tested the new run_L1EM_withlessmemory.sh yet, though.

Thanks, Federico