diff --git a/LICENSE.txt b/LICENSE.txt index 918bf80..2dff4d1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,10 @@ -Copyright (c) 2016, GabeAl +Copyright (c) 2016, KnightsLab +Individual software components are subject to their own licenses, and +these supercede the terms of this license where appropriate. + +Trimmomatic: GPLv3, FLASH: GPLv3 +GPLv3 license: https://github.com/timflutre/trimmomatic/blob/master/distSrc/LICENSE + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/shi7/__init__.py b/bin/__init__.py similarity index 100% rename from shi7/__init__.py rename to bin/__init__.py diff --git a/shi7en/adapters/NexteraPE-PE.fa b/bin/adapters/NexteraPE-PE.fa similarity index 100% rename from shi7en/adapters/NexteraPE-PE.fa rename to bin/adapters/NexteraPE-PE.fa diff --git a/shi7en/adapters/TruSeq2-PE.fa b/bin/adapters/TruSeq2-PE.fa similarity index 100% rename from shi7en/adapters/TruSeq2-PE.fa rename to bin/adapters/TruSeq2-PE.fa diff --git a/shi7en/adapters/TruSeq2-SE.fa b/bin/adapters/TruSeq2-SE.fa similarity index 100% rename from shi7en/adapters/TruSeq2-SE.fa rename to bin/adapters/TruSeq2-SE.fa diff --git a/shi7en/adapters/TruSeq3-PE-2.fa b/bin/adapters/TruSeq3-PE-2.fa similarity index 100% rename from shi7en/adapters/TruSeq3-PE-2.fa rename to bin/adapters/TruSeq3-PE-2.fa diff --git a/shi7en/adapters/TruSeq3-PE.fa b/bin/adapters/TruSeq3-PE.fa similarity index 100% rename from shi7en/adapters/TruSeq3-PE.fa rename to bin/adapters/TruSeq3-PE.fa diff --git a/shi7en/adapters/TruSeq3-SE.fa b/bin/adapters/TruSeq3-SE.fa similarity index 100% rename from shi7en/adapters/TruSeq3-SE.fa rename to bin/adapters/TruSeq3-SE.fa diff --git a/shi7/shi7.py b/bin/shi7.py old mode 100644 new mode 100755 similarity index 95% rename from shi7/shi7.py rename to bin/shi7.py index db29ef8..965f415 --- a/shi7/shi7.py +++ b/bin/shi7.py @@ -33,7 +33,7 @@ def convert_t_or_f(value): def make_arg_parser(): # TODO: Preset modes will get precedence over default values, but lose to explicit settings from user parser = argparse.ArgumentParser(description='This is the commandline interface for shi7', - usage='shi7 -i -o ...') + usage='shi7 v0.91 -i -o ...') parser.add_argument('--gotta_split', help='Split one giant fastq (or one pair of R1/R2) into 1 fastq per sample', dest='split', choices=[True,False], default='False', type=convert_t_or_f) parser.add_argument('--gotta_split_output', help='output directory for the newly-split fastqs') parser.add_argument('--gotta_split_r1', help='r1 to split') @@ -93,9 +93,21 @@ def run_command(cmd, shell=False): def format_basename(filename): if t_f_values[STRIP]: - return '.'.join(re.sub('[^0-9a-zA-Z]+', '.', re.sub('_L001', '', re.sub('_001', '', (os.path.basename(filename)).split('_')[0]))).split('.')[:-1]) + parts = os.path.basename(filename).split('_') + if len(parts) == 1: + return re.sub('[^0-9a-zA-Z]+', '.', '.'.join(parts[0].split('.')[:-1])) + else: + appendage = '' + for section in parts[1:]: + if section.find("R1") != -1: + appendage = 'R1' + elif section.find("R2") != -1: + appendage = 'R2' + return re.sub('[^0-9a-zA-Z]+', '.', parts[0])+appendage else: - return '.'.join(re.sub('[^0-9a-zA-Z]+', '.', re.sub('_L001', '', re.sub('_001', '', os.path.basename(filename)))).split('.')[:-1]) + return re.sub('[^0-9a-zA-Z]+', '.', '.'.join(os.path.basename(filename).split('.')[:-1])) + +#return '.'.join(re.sub('[^0-9a-zA-Z]+', '.', re.sub('_L001', '', re.sub('_001', '', os.path.basename(filename)))).split('.')[:-1]) def whitelist(dir, whitelist): for root, subdirs, files in os.walk(dir):