<commit_before>#!usr/bin/bash

# Abstract: This shell script iterates through all data folders and
#           uses cutadapt package for trimming paired end reads. For
#           more information about cutadapt, please refer to this -
#           http://cutadapt.readthedocs.org/en/latest/guide.html#trimming-paired-end-reads

# Date: 07/17/2015

# Author: <NAME>

# Set up for loop in parent directory
for dir in */
do
    printf "%s\n" "$dir"    # print the folder name which is being processed
    # cd into each folder in the directory
    cd "$dir" || { echo "cd into data folder failed! Please check your working directory." ; exit 1 ; }

    printf 'START\n'

    FILE1=(*R1_001.fastq.gz)
    FILE2=(*R2_001.fastq.gz)

#   Trimming spacers regions (attached to 5' ends) in the sequence
    printf "Trimming V1-V3 spacers in Plate 1 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'ADAPTER_FWD' -G 'ADAPTER_REV' -o P1_R1_V1-V3_out.fastq -p P1_R2_V1-V3_out.fastq "${FILE1[*]}" "${FILE2[*]}" > plate1_V1-V3_summary.txt
    printf "Done!\n"

    printf "Trimming V4-V5 spacers in Plate 1 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'ADAPTER_FWD' -G 'ADAPTER_REV' -o P1_R1_V4-V5_out.fastq -p P1_R2_V4-V5_out.fastq "${FILE1[*]}" "${FILE2[*]}" > plate1_V4-V5_summary.txt
    printf "Done!\n"

    printf "Trimming V1-V3 spacers in Plate 2 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'ADAPTER_FWD' -G 'ADAPTER_REV' -o P2_R1_V1-V3_out.fastq -p P2_R2_V1-V3_out.fastq "${FILE1[*]}" "${FILE2[*]}" > plate2_V1-V3_summary.txt
    printf "Done!\n"

    printf "Trimming V4-V5 spacers in Plate 2 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'ADAPTER_FWD' -G 'ADAPTER_REV' -o P2_R1_V4-V5_out.fastq -p P2_R2_V4-V5_out.fastq "${FILE1[*]}" "${FILE2[*]}" > plate2_V4-V5_summary.txt
<commit_msg>Updated runny.sh<commit_after>#!usr/bin/bash

# Abstract: This shell script iterates through all data folders and
#           uses cutadapt package for trimming paired end reads. For
#           more information about cutadapt, please refer to this -
#           http://cutadapt.readthedocs.org/en/latest/guide.html#trimming-paired-end-reads

# Date: 07/17/2015

# Author: <NAME>

# Set up for loop in parent directory
for dir in */
do
    printf "%s\n" "$dir"    # print the folder name which is being processed
    # cd into each folder in the directory
    cd "$dir" || { echo "cd into data folder failed! Please check your working directory." ; exit 1 ; }

    printf 'START\n'

    FILE1=(*R1_001.fastq.gz)
    FILE2=(*R2_001.fastq.gz)

#   Trimming spacers regions (attached to 5' ends) in the sequence
    printf "Trimming V1-V3 spacers in Plate 1 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'TCGATCGGAAKRGTTYGATYNTGGCTCAG' -G 'CGGACTTGATGTACGAACGTNTBACCGCDGCTGCTG' -o P1_R1_V1-V3_out.fastq -p P1_R2_V1-V3_out.fastq --trimmed-only "${FILE1[*]}" "${FILE2[*]}" > plate1_V1-V3_summary.txt
    printf "Done!\n"

    printf "Trimming V4-V5 spacers in Plate 1 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'CGAGCAATCCACTCGAGTGCCAGCMGCCGCGGTAA' -G 'GATTAGCTGCACGGACTACHVGGGTWTCTAAT' -o P1_R1_V4-V5_out.fastq -p P1_R2_V4-V5_out.fastq --trimmed-only "${FILE1[*]}" "${FILE2[*]}" > plate1_V4-V5_summary.txt
    printf "Done!\n"

    printf "Trimming V1-V3 spacers in Plate 2 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'ATCTGTCATGGAAKRGTTYGATYNTGGCTCAG' -G 'TCAGTAGCTACGCACGTNTBACCGCDGCTGCTG' -o P2_R1_V1-V3_out.fastq -p P2_R2_V1-V3_out.fastq --trimmed-only "${FILE1[*]}" "${FILE2[*]}" > plate2_V1-V3_summary.txt
    printf "Done!\n"

    printf "Trimming V4-V5 spacers in Plate 2 for %s and %s\n" "${FILE1[*]}" "${FILE2[*]}"
    cutadapt -g 'GATCAGTCGTCTCACTCGAGTGCCAGCMGCCGCGGTAA' -G 'ATCAGCAACGGACTACHVGGGTWTCTAAT' -o P2_R1_V4-V5_out.fastq -p P2_R2_V4-V5_out.fastq --trimmed-only "${FILE1[*]}" "${FILE2[*]}" > plate2_V4-V5_summary.txt

{'fraction_non_alphanumeric': 0.15813598166539344, 'fraction_numerical': 0.046855105678635094, 'mean_word_length': 3.715486194477791, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '602133', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1605, 'n_words': 399}