Example #1
0
     - The input and output default is rawReads/samplesubfolder/
     - It also returns a table and a plot with the number of reads for each sample, the output by default is Report/figure/data """

    # Parser
    parser = argparse.ArgumentParser(prog='qcReads.py', description = 'Quality control of data using FastQC')
    parser.add_argument('-v', '--version', action='version', version='%(prog)s-'+__version__)
    parser.add_argument('--analysis_info_file', help='Text file with details of the analysis. Default=analysis_info.txt', default='analysis_info.txt')
    parser.add_argument('--in_dir', help='Path to folder containing fastq files. Default=rawReads/', default='rawReads/')
    parser.add_argument('--out_dir', help='Path to out put folder. Default=rawReads/', default='rawReads/')
    parser.add_argument('--out_dir_report', help='Path to out put folder. Default=Report/figure/data/', default='Report/figure/data/')
    parser.add_argument('--sample_names_file', help='Text file with sample names. Default=sample_names.txt', default='sample_names.txt')
    parser.add_argument('--ncores', help='Number of cores to use. Default=8', default='8')
    args=parser.parse_args()

    # Set path of working directory
    ai=functions.read_analysis_info_file(args.analysis_info_file)
    path=os.getcwd()

    #Ncores
    ncores=int(args.ncores)

    # Read sample names text file
    sample_names_file=args.sample_names_file
    sampleNames = functions.read_sample_names(sample_names_file)

    # Set input and output directories if not 'rawReads/'
    in_dir=path + '/' + args.in_dir
    out_dir=path + '/' +args.out_dir
    out_dir_report=path + '/' + args.out_dir_report

    # Create out_dir_report
Example #2
0
__version__='v01'
# created 17/08/2016

if __name__ == '__main__':

    # Parser
    parser = argparse.ArgumentParser(prog='organizeWorkingDirectory.py',description = 'Organize working directory of the analysis')
    parser.add_argument('-v','--version', action='version',version='%(prog)s-'+__version__)
    parser.add_argument('--analysis_info_file', help='Text file with details of the analysis. Default=analysis_info.txt', default='analysis_info.txt')
    parser.add_argument('--sample_names_file', help='Text file with sample names. Default=sample_names_info.txt', default='sample_names.txt')
    parser.add_argument('--in_dir', help='directory with fastq files. Default= corresponding to bcl2fastq_output', default='bcl2fastq_output')
    args=parser.parse_args()

    # Read analysis info file
    ai=functions.read_analysis_info_file(args.analysis_info_file)
    
    # Change dir
    os.chdir(ai['project_location'])

    # Read sample names
    sample_names_file = args.sample_names_file
    sampleNames = functions.read_sample_names(sample_names_file)
        
    # Create rawReads folder
    # Check if rawReads exists
    project_location=ai['project_location']
    folders = os.listdir(project_location)
    readsFiles = [folders[i] for i, x in enumerate(folders) if re.findall('rawReads',x)]
    # print readsFiles