flowcraft/templates/trimmomatic.py
def clean_up(fastq_pairs, clear):
    """Cleans the working directory of unwanted temporary files"""

    # Find unpaired fastq files
    unpaired_fastq = [f for f in os.listdir(".")
                      if f.endswith("_U.fastq.gz")]

    # Remove unpaired fastq files, if any
    for fpath in unpaired_fastq:
        os.remove(fpath)

    # Expected output to assess whether it is safe to remove temporary input
    expected_out = [f for f in os.listdir(".") if f.endswith("_trim.fastq.gz")]

    if clear == "true" and len(expected_out) == 2:
        for fq in fastq_pairs:
            # Get real path of fastq files, following symlinks
            rp = os.path.realpath(fq)
            logger.debug("Removing temporary fastq file path: {}".format(rp))
            if re.match(".*/work/.{2}/.{30}/.*", rp):
                os.remove(rp)
def clean_up(fastq_pairs, clear):
    # Find unpaired fastq files
    unpaired_fastq = [f for f in os.listdir(".")
                      if f.endswith("_U.fastq.gz")]

    # Remove unpaired fastq files, if any
    for fpath in unpaired_fastq:
        os.remove(fpath)

    # Expected output to assess whether it is safe to remove temporary input
    expected_out = [f for f in os.listdir(".") if f.endswith("_trim.fastq.gz")]

    if clear == "true" and len(expected_out) == 2:
        for fq in fastq_pairs:
            # Get real path of fastq files, following symlinks
            rp = os.path.realpath(fq)
            logger.debug("Removing temporary fastq file path: {}".format(rp))
            if re.match(".*/work/.{2}/.{30}/.*", rp):
                os.remove(rp)
def clean_up ( fastq_pairs , clear ) : # Find unpaired fastq files unpaired_fastq = [ f for f in os . listdir ( "." ) if f . endswith ( "_U.fastq.gz" ) ] # Remove unpaired fastq files, if any for fpath in unpaired_fastq : os . remove ( fpath ) # Expected output to assess whether it is safe to remove temporary input expected_out = [ f for f in os . listdir ( "." ) if f . endswith ( "_trim.fastq.gz" ) ] if clear == "true" and len ( expected_out ) == 2 : for fq in fastq_pairs : # Get real path of fastq files, following symlinks rp = os . path . realpath ( fq ) logger . debug ( "Removing temporary fastq file path: {}" . format ( rp ) ) if re . match ( ".*/work/.{2}/.{30}/.*" , rp ) : os . remove ( rp )
Cleans the working directory of unwanted temporary files
Cleans the working directory of unwanted temporary files