Next changeset 1:ef126d319834 (2016-08-11) |
Commit message:
Uploaded |
added:
calc_fitness.py |
b |
diff -r 000000000000 -r 06fca5f064fd calc_fitness.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calc_fitness.py Thu Aug 11 17:40:50 2016 -0400 |
[ |
b'@@ -0,0 +1,757 @@\n+# A translation of calc_fitness.pl into python! For analysis of Tn-Seq.\n+# This script requires BioPython, which in turn has a good number of dependencies (some optional but very helpful).\n+# How to install BioPython and a list of its dependencies can be found here: http://biopython.org/DIST/docs/install/Installation.html\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+##### ARGUMENTS #####\n+\n+def print_usage():\n+\tprint "\\n" + "You are missing one or more required flags. A complete list of flags accepted by calc_fitness is as follows:" + "\\n\\n"\n+\tprint "\\033[1m" + "Required" + "\\033[0m" + "\\n"\n+\tprint "-ref" + "\\t\\t" + "The name of the reference genome file, in GenBank format." + "\\n"\n+\tprint "-t1" + "\\t\\t" + "The name of the bowtie mapfile from time 1." + "\\n"\n+\tprint "-t2" + "\\t\\t" + "The name of the bowtie mapfile from time 2." + "\\n"\n+\tprint "-out" + "\\t\\t" + "Name of a file to enter the .csv output." + "\\n"\n+\tprint "\\n"\n+\tprint "\\033[1m" + "Optional" + "\\033[0m" + "\\n"\n+\tprint "-expansion" + "\\t\\t" + "Expansion factor (default: 250)" + "\\n"\n+\tprint "-d" + "\\t\\t" + "All reads being analyzed are downstream of the transposon" + "\\n"\n+\tprint "-reads1" + "\\t\\t" + "The number of reads to be used to calculate the correction factor for time 0." + "\\n\\t\\t" + "(default counted from bowtie output)" + "\\n"\n+\tprint "-reads2" + "\\t\\t" + "The number of reads to be used to calculate the correction factor for time 6." + "\\n\\t\\t" + "(default counted from bowtie output)" + "\\n"\n+\tprint "-cutoff" + "\\t\\t" + "Discard any positions where the average of counted transcripts at time 0 and time 1 is below this number (default 0)" + "\\n"\n+\tprint "-cutoff2" + "\\t\\t" + "Discard any positions within the normalization genes where the average of counted transcripts at time 0 and time 1 is below this number (default 0)" + "\\n"\n+\tprint "-strand" + "\\t\\t" + "Use only the specified strand (+ or -) when counting transcripts (default: both)" + "\\n"\n+\tprint "-normalize" + "\\t" + "A file that contains a list of genes that should have a fitness of 1" + "\\n"\n+\tprint "-maxweight" + "\\t" + "The maximum weight a transposon gene can have in normalization calculations" + "\\n"\n+\tprint "-multiply" + "\\t" + "Multiply all fitness scores by a certain value (e.g., the fitness of a knockout). You should normalize the data." + "\\n"\n+\tprint "-ef" + "\\t\\t" + "Exclude insertions that occur in the first N amount (%) of gene--becuase may not affect gene function." + "\\n"\n+\tprint "-el" + "\\t\\t" + "Exclude insertions in the last N amount (%) of the gene--considering truncation may not affect gene function." + "\\n"\n+\tprint "-wig" + "\\t\\t" + "Create a wiggle file for viewing in a genome browser. Provide a filename." + "\\n"\n+\tprint "-uncol" + "\\t\\t" + "Use if reads were uncollapsed when mapped." + "\\n"\n+\tprint "\\n"\n+\n+import argparse \n+parser = argparse.ArgumentParser()\n+parser.add_argument("-ref", action="store", dest="ref_genome")\n+parser.add_argument("-t1", action="store", dest="mapfile1")\n+parser.add_argument("-t2", action="store", dest="mapfile2")\n+parser.add_argument("-out", action="store", dest="outfile")\n+parser.add_argument("-out2", action="store", dest="outfile2")\n+parser.add_argument("-expansion", action="store", dest="expansion_factor")\n+parser.add_argument("-d", action="store", dest="downstream")\n+parser.add_argument("-reads1", action="store", dest="reads1")\n+parser.add_argument("-reads2", action="store", dest="reads2")\n+parser.add_argument("-cutoff", action="store", dest="cutoff")\n+parser.add_argument("-cutoff2", action="store", dest="cutoff2")\n+parser.add_argument("-strand", action="store", dest="usestrand")\n+parser.add_argument("-normalize", action="store", dest="normalize")\n+parser.add_argument("-maxweight", action="store", dest="max_weight")\n+parser.add_argument("-multiply", action="store", dest="multiply")\n+parser.add_argument("-ef", action="store", dest="exclude_first")\n+parser.add_argument("-el", action="store", dest="exclude_last")\n+parser.add_argument("-wig", action="st'..b" `````````````````````````@##@``````````````````@##;```````````````````````````` ``+@@@@`` \n+# ````###,```` ````+##@``` ``+@@@@`` \n+# ``,###``` ``.@##``` ``'@@@@`` \n+# ``###@`` ```@##``` ``'@@@@`` \n+# ```@##@`` ``@##+`` ``'@@@@`` \n+# ```###.`` ``:##@`` ``'@@@@`` \n+# ``:###``` ```##@``` ``'@@@@`` \n+# ``@##@`` ```@##``` ``'@@@@`` \n+# ```@##'`` ``@###`` ``'@@@@`` \n+# ```@##``` ```##@`` ``'@@@@`` \n+# ``,###``` ```@#@``` ``'@@@@`` \n+# ``####`` ``@##.`` ``'@@@@`` \n+# ``@##@`` ``;##@`` ``'@@@@`` \n+# `````````@##@`` ```##@```` ``;@@@@`` \n+# ``````````````@##;`` ```###`````````````` ``;@@@@`` \n+# `````````.,;.```###``` ``@##:`````````````` ``;@@@@`` \n+# `````#@#########@@##``` ``###@@@@@@###@#@'``` ``;@@@@`` \n+# ```@@###############@`` ``,################`` ``;@@@@`` \n+# ``'@################+`` ```###############+`` ``;@@@@`` \n+# `````````````````````` ``###########@#,```` ``.@@@@`` \n+# ````````````````````` ``````````````````` ```@@@.` \n+# ```````````````` ``````` \n+# \n+#\n\\ No newline at end of file\n" |