コード例 #1
0
ファイル: qBio_Quantify.py プロジェクト: sbs87/qpcr
def read_HT_method(filename): 
    file=bmath.readfile(filename) # Read file contents using the bmath (should rename) custom python module. This simply reads all of a file's contents, and puts it into a vector of vectors, line by line
    mapping={}
    for line in file: # Read in each line one by one from the read in file
    	#Note the expected format of the HT file... the first col should be the species and the second should be the abundance or counts of metagenomic or 16s data, respectively. In other words, each time point should be separated out so that only these two fields exist. 
        #Also, the species names should match exactly to those in the qBio species list, or else they can't be compared.
        species=line[0]
        abundance=line[1] #Can also be counts, abundance is just a variable name
        mapping.update({species:abundance})
    return mapping #Returns species:number Note that the species list will be partially non overlapping with the qBio species list.
コード例 #2
0
ファイル: qBio_Quantify.py プロジェクト: sbs87/qpcr
	return agreement,summary_table #Species val16 valq category. Seprate, formatted tablle

#------------------
#-------Define variables
#------------------

#---The following are variables defined by input stream. this will be inside the wrapper script, so these values have either been formatted by the .sh wrapper or are fed directly from command line
data_filename=sys.argv[1] #Pointing to source of input data, formatted by .sh script
thres_filename=sys.argv[2] #Pointing to threshold file, contained in .sh script, hardcoded  
outfile_prefix=sys.argv[3] #formatting to outfile filename prefix, formatted by .sh script as qBio_subID_WXDY_MMDDYY_
rRNA16s_filename=sys.argv[4] #Should be changed to HTMethod_filename, but this points to the HT method data filename, ie, reads or abundance values for 16s or metagenome
HT_type=sys.argv[5] #Passed from command line, this is either 16s or meta and will be used to write output files depending on the HT method 
ht_count_thres=sys.argv[6] #assignment to ht_method cutoff

#The folliing read in the entire filecontnes using a custom bmath package filereader. 
data_file=bmath.readfile(data_filename) 
thres_file=bmath.readfile(thres_filename)

#Define the control and other lists to be read in later. This is hardcoded because it is assumed these controls won't change. 
control_list=["Pan Bacteria 1","Pan Bacteria 2","Hs/MmGAPDH","Hs/Mm HBB"]
other_control_list=["PPC","Pan Aspergillus/Candida"]
sample_list=[]

#------------------
#-------Start main program
#------------------

#----Read in files, values 

#Read in the sample list and it's correspond mean ct val and st dev (not used) (created by wrapper script by cat the vals generated from QC script)
#This is the sample list, not the control list...