wyang17 / SQuIRE

Software for Quantifying Interspersed Repeat Expression
Other
49 stars 30 forks source link

Error with loop_map.sh #72

Open GimenaA opened 2 years ago

GimenaA commented 2 years ago

I tried to run the loop_map.sh script, because I have multiple samples. The first sample ran with loop_map.sh with no issues, but I get an error with the second sample. It seems it's not separating the paths from sample_0 files and sample_1 files so it writes them together. Below is the error I'm getting:

Loading arguments stat: cannot stat '/home/gimena/scripts/simulation_scripts/trial_run/trial1/squire_map/sample_0.bam': No such file or directory Loading arguments read1 /home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_1_fixed.fasta read2 /home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_2_fixed.fasta Setting up environment Running Map start time is:2022-02-09 10:40:41.953919

Map.pyc

Script Arguments

fetch_folder=/home/gimena/squire_references/dm6/squire_fetch name=sample_0 extra=None read_length=100 verbosity=True pthreads=100 read1=/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_1_fixed.fasta read2=/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_2_fixed.fasta build=dm6 func=<function main at 0x7fcfba5add70> trim3=0 map_folder=/home/gimena/scripts/simulation_scripts/trial_run/trial1/squire_map

Aligning FastQ files for Read1 and Read2 2022-02-09 10:40:41.954293

Feb 09 10:40:41 ..... started STAR run Feb 09 10:40:41 ..... loading genome Feb 09 10:40:43 ..... processing annotations GTF Feb 09 10:40:44 ..... inserting junctions into the genome indices Feb 09 10:41:11 ..... started 1st pass mapping Feb 09 10:41:56 ..... finished 1st pass mapping Feb 09 10:41:56 ..... inserting junctions into the genome indices Feb 09 10:42:10 ..... started mapping Feb 09 10:43:19 ..... finished successfully finished writing outputs

end time is: 2022-02-09 10:44:19.576678

it took: 0:03:37.622759

Map Complete on Wed 09 Feb 2022 10:44:19 AM EST

stat: cannot stat '/home/gimena/scripts/simulation_scripts/trial_run/trial1/squire_map/sample_1.bam': No such file or directory Loading arguments read1 /home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_1_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_1_fixed.fasta read2 /home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_2_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_2_fixed.fasta Setting up environment Running Map start time is:2022-02-09 10:44:21.118944

Map.pyc

Script Arguments

fetch_folder=/home/gimena/squire_references/dm6/squire_fetch name=sample_1 extra=None read_length=100 verbosity=True pthreads=100 read1=/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_1_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_1_fixed.fasta read2=/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_2_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_2_fixed.fasta build=dm6 func=<function main at 0x7f8c3f24dc80> trim3=0 map_folder=/home/gimena/scripts/simulation_scripts/trial_run/trial1/squire_map

Aligning FastQ files for Read1 and Read2 2022-02-09 10:44:21.119320

EXITING because of fatal input ERROR: could not open readFilesIn=/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_1_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_1_fixed.fasta

Feb 09 10:44:21 ...... FATAL ERROR, exiting
Traceback (most recent call last): File "/home/gimena/miniconda3/envs/squire/bin/squire", line 11, in load_entry_point('SQuIRE', 'console_scripts', 'squire')() File "/home/gimena/SQuIRE/squire/cli.py", line 156, in main subargs.func(args = subargs) File "/home/gimena/SQuIRE/squire/Map.py", line 387, in main align_paired(read1,read2,pthreads,trim3,index,outfile,gtf,gzip,prefix, read_length,extra_fapath) File "/home/gimena/SQuIRE/squire/Map.py", line 132, in align_paired sp.check_call(["/bin/sh", "-c", STARcommand]) File "/home/gimena/miniconda3/envs/squire/lib/python2.7/subprocess.py", line 186, in check_call raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '-c', 'STAR --runThreadN 100 --clip3pNbases 0 --outFilterMultimapNmax 100 --winAnchorMultimapNmax 100 --alignEndsType EndToEnd --alignEndsProtrude 100 DiscordantPair --outFilterScoreMinOverLread 0.4 --outFilterMatchNminOverLread 0.4 --chimSegmentMin 100 --genomeDir /home/gimena/squire_references/dm6/squire_fetch/dm6_STAR --readFilesIn /home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_1_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_1_fixed.fasta /home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_0_2_fixed.fasta/home/gimena/scripts/simulation_scripts/sample_sims_reads/sample_1_2_fixed.fasta --outFileNamePrefix /home/gimena/scripts/simulation_scripts/trial_run/trial1/squire_map/sample_1 --outSAMtype BAM Unsorted --outSAMattributes All --outSAMstrandField intronMotif --outSAMattrIHstart 0 --sjdbGTFfile /home/gimena/squire_references/dm6/squire_fetch/dm6_refGene.gtf --sjdbOverhang 99 --twopassMode Basic']' returned non-zero exit status 102 Map Complete on Wed 09 Feb 2022 10:44:21 AM EST

I'm not sure how to fix error. Has anyone else experience this error and has any suggestion on how to fix it?? Any help would be greatly appreciated!!

jpcartailler commented 2 years ago

Not the author, but the error messages tell you what's going on - No such file or directory. You should check paths in your input parameters, and check to see if those files it's complaining about are where they need to be.

GimenaA commented 2 years ago

Not the author, but the error messages tell you what's going on - No such file or directory. You should check paths in your input parameters, and check to see if those files it's complaining about are where they need to be.

@c5creative Thank you for your input. However, the "No such file or directory" messages are not what's causing my problem. Those come from the stat command on lines 41 and 45 of the script where according to the script it's checking if map has already been completed. My issue was that it was concatenating the paths to read1 and read2 files from samples 0 and samples 1 when running sample 1 (highlighted in bold in my original message). Luckily, I was able to fix this issue by removing "+" sign in lines 28 and 37 of the loop_map.sh.

GimenaA commented 2 years ago

UPDATE: I fixed this issue by removing the "+" sign in lines 28 and 37 of the loop_map.sh script.

Original code: read1+=${fastq}

Modified code: read1=${fastq}

Original code: read2+=${fastq}

Modified code: read2=${fastq}