# Title goes here ## Here's a subtitle Here's some text explaining the command I'm trying to run ```bash= ls /lustre/scratch/joh97948/plastid_elle/half_volume_reads ``` ## FastP Here's the [link to the tool I'm using](https://github.com/OpenGene/fastp) Running one sample ``` fastp -I /lustre/scratch/joh97948/plastid_elle/half_volume_reads/ABRONIAseq068*R1_001.fastq.gz -i /lustre/scratch/joh97948/plastid_elle/half_volume_reads/ABRONIAseq068*R2_001.fastq.gz -O ABRONIAseq068.trimmed.R1.fastq.gz -o ABRONIAseq068.trimmed.R2.fastq.gz -j ABRONIAseq068.json -h ABRONIAseq068.html ``` ``` fastp -I /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq068*R1_001.fastq.gz -i /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq070*R2_001.fastq.gz -O ABRONIAseq070.trimmed.R1.fastq.gz -o ABRONIAseq068.trimmed.R2.fastq.gz -j ABRONIAseq068.json -h ABRONIAseq068.html fastp -I /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq068*R1_001.fastq.gz -i /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq070*R2_001.fastq.gz -O ABRONIAseq071.trimmed.R1.fastq.gz -o ABRONIAseq071.trimmed.R2.fastq.gz -j ABRONIAseq071.json -h ABRONIAseq071.html ``` Running one sample but define the name first: ``` name=VIOLAseq004 fastp -I /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/VIOLAseq005_M.1.trimmed.fastq.gz -i /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/VIOLAseq005_M.2.trimmed.fastq.gz -O VIOLAseq005.trimmed_M.1.fastq.gz -o VIOLAseq005.trimmed.R2.fastq.gz -j VIOLAseq005.json -h VIOLAseq005.html ``` ``` name=ABRONIAseq071 fastp -i /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq071_S756_L002_R1_001.fastq.gz -I /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq071_S756_L002_R2_001.fastq.gz -o ABRONIAseq071_R1.trimmed.fastq.gz -O ABRONIAseq071.trimmed_R2.fastq.gz -j ABRONIAseq071.json -h ABRONIAseq071.html ABRONIAseq071_S756_L002_R1_001 fastp -i /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq071_S756_L002_R1_001.fastq.gz -I /lustre/scratch/joh97948/plastid_elle/tenth_volume_reads/ABRONIAseq071_S756_L002_R2_001.fastq.gz -o ABRONIAseq071.trimmed_R1.fastq.gz -O ABRONIAseq071.trimmed_R2.fastq.gz -j ABRONIAseq071.json -h ABRONIAseq071.html ``` Loop Attempt [help](https://stackoverflow.com/questions/1521462/looping-through-the-content-of-a-file-in-bash) ``` #clean up data while read name; do fastp -I /lustre/research/joh97948/Abronia/$name_R1_001.fastq.gz -i /lustre/research/joh97948/Abronia/$name_R2_001.fastq.gz -O $name.trimmed_R1.fastq.gz -o $name.trimmed_R2.fastq.gz -j $name.json -h $name.html; done </lustre/scratch/eliostev/samlist.txt #read all names in samplelist.txt for word in $(/lustre/scratch/joh97948/plastid_elle/samplelist.txt); do echo $word; done ``` ``` while read name; do fastp \ -i /lustre/research/joh97948/Abronia/${name}_R1_001.fastq.gz \ -I /lustre/research/joh97948/Abronia/${name}_R2_001.fastq.gz \ -o ${name}.trimmed_R1.fastq.gz \ -O ${name}.trimmed_R2.fastq.gz \ -j ${name}.json \ -h ${name}.html done < /lustre/scratch/eliostev/samlist.txt while read name; do fastp \ -i /lustre/research/joh97948/Abronia/${name}_R1_001.fastq.gz \ -I /lustre/research/joh97948/Abronia/${name}_R2_001.fastq.gz \ -o ${name}.trimmed_R1.fastq.gz \ -O ${name}.trimmed_R2.fastq.gz \ -j ${name}.json \ -h ${name}.html done < /home/eliostev/seqlistJAN.txt ``` Loop with Hybpiper ``` hybpiper assemble -t_aa /lustre/scratch/joh97948/plastid_elle/plastid_targets.faa -r ABRONIAseq070.trimmed.R*.fastq.gz --prefix ABRONIAseq070 --diamond while read name; do hybpiper assemble -t_aa /lustre/scratch/joh97948/plastid_elle/plastid_targets.faa -r $name*.trimmed_R*.fastq.gz --prefix $name --diamond; done </lustre/scratch/joh97948/plastid_elle/samplelist.txt ``` Loop with Hybpiper 2 ``` hybpiper assemble -t_aa /lustre/scratch/joh97948/plastid_elle/plastid_targets.faa -r ABRONIAseq070.trimmed.R*.fastq.gz --prefix ABRONIAseq070 --diamond hybpiper assemble -t_aa /lustre/scratch/madbullo/LibMin/plastid_targets.faa -r ABRONIAseq071.R*.paired.fastq.gz --prefix ABRONIAseq071 --diamond while read name; do hybpiper assemble -t_aa /lustre/scratch/madbullo/LibMin/plastid_targets.faa -r $name*.R*.paired.fastq.gz --prefix $name --diamond; done </home/eliostev/seqlistJAN.txt ``` submit job ``` # hybpiper_loop.sh # cp - copy mkdir slurms #make directory slurms cd slurms #access nano hybpiper_loop.sh #use workspace to write loop #edit, etc. sbatch hybpiper_loop.sh #submit job squeue -u eliostev #check jobs #or cd /lustre/scratch/eliostev ls #make sure is correct sbatch ~/slurms/hybpiper_loop.sh #cancel job scancel #job id here ``` run stats! ``` hybpiper stats -t_aa /lustre/scratch/joh97948/plastid_elle/plastid_targets.faa gene /lustre/scratch/eliostev/halfVol_results/samplelist.txt hybpiper stats -t_aa /lustre/scratch/joh97948/plastid_elle/plastid_targets.faa gene /lustre/scratch/eliostev/samplelist2.txt hybpiper stats -t_aa /lustre/scratch/madbullo/LibMin/plastid_targets.faa gene /lustre/scratch/eliostev/seqlistJAN.txt ``` ``` /lustre/work/joh97948/angiosperms353.abronia.fasta <-- target file while read name; do fastp \ -i /lustre/research/joh97948/Abronia/${name}_M.1.trimmed.fastq.gz \ -I /lustre/research/joh97948/Abronia/${name}_M.2.trimmed.fastq.gz \ -o ${name}.trimmed_R1.fastq.gz \ -O ${name}.trimmed_R2.fastq.gz \ -j ${name}.json \ -h ${name}.html done < /lustre/scratch/joh97948/plastid_elle/samplelist.txt average length --- #!/bin/bash indir="/lustre/scratch/eliostev/abronia/Abronia" outdir="/lustre/scratch/eliostev/trimmed" mkdir -p "$outdir" while read -r name; do R1=$(ls ${indir}/${name}*_R1_001.fastq.gz 2>/dev/null | head -n1) R2=$(ls ${indir}/${name}*_R2_001.fastq.gz 2>/dev/null | head -n1) if [[ -z "$R1" || -z "$R2" ]]; then echo "pairs not found: $name" continue fi fastp \ -i "$R1" \ -I "$R2" \ -o ${outdir}/${name}.trimmed_R1.fastq.gz \ -O ${outdir}/${name}.trimmed_R2.fastq.gz \ -j ${outdir}/${name}.json \ -h ${outdir}/${name}.html done < /lustre/scratch/eliostev/samlist2.txt ```