Previous changeset 17:5e346d75ccf3 (2019-06-03) Next changeset 19:fe79425b1fa4 (2019-06-03) |
Commit message:
Uploaded |
modified:
Tryp_V.py |
b |
diff -r 5e346d75ccf3 -r e7da2274c9f6 Tryp_V.py --- a/Tryp_V.py Mon Jun 03 15:59:39 2019 -0400 +++ b/Tryp_V.py Mon Jun 03 16:00:24 2019 -0400 |
[ |
b'@@ -1,2064 +1,292 @@\n+"""\n+ * Copyright 2018 University of Liverpool\n+ * Author: John Heap, Computational Biology Facility, UoL\n+ * Based on original scripts of Sara Silva Pereira, Institute of Infection and Global Health, UoL\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the "License");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an "AS IS" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ *\n+ """\n \n+import matplotlib as mpl\n+mpl.use(\'Agg\')\n \n+import subprocess\n+import shutil\n+import re\n+import pandas as pd\n+import os\n \n+import sys\n \n+import matplotlib.pyplot as plt\n+from matplotlib.patches import Patch\n+import seaborn as sns\n+\n+def assembleWithVelvet(name, kmers, inslen, covcut, fastq1name,fastq2name):\n+ #argString = "velveth " + name + "_k65 65 -shortPaired -fastq " + name + "_R1.fastq " + name + "_R2.fastq"\n+ argString = "velveth " + name + "_k"+ kmers+" "+ kmers + " -shortPaired -fastq " + fastq1name+" "+fastq2name\n+ print(argString)\n+ returncode = subprocess.call(argString, shell=True)\n+ if returncode != 0:\n+ return "Error in velveth"\n+ argString = "velvetg " + name + "_k"+kmers+" -exp_cov auto -ins_length "+inslen+" -clean yes -ins_length_sd 50 -min_pair_count 20"\n+ #argString = "velvetg " + name + "_k"+kmers+" -exp_cov auto -ins_length "+inslen+" -cov_cutoff "+covcut+" -clean yes -ins_length_sd 50 -min_pair_count 20"\n+ #argString = "velvetg " + name + "_k65 -exp_cov auto -ins_length 400 -cov_cutoff 5 -clean yes -ins_length_sd 50 -min_pair_count 20"+quietString\n+ print(argString)\n+ returncode = subprocess.call(argString, shell = True)\n+ if returncode != 0:\n+ return "Error in velvetg"\n+ shutil.copyfile(name + "_k"+kmers+"//contigs.fa",name + ".fa") # my $namechange = "mv ".$input."_k65/contigs.fa ".$input.".fa";\n+ return "ok"\n \n \n-<!DOCTYPE html>\n-<html lang="en">\n- <head>\n- <meta charset="utf-8">\n- <link rel="dns-prefetch" href="https://github.githubassets.com">\n- <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">\n- <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com">\n- <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com">\n- <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com">\n- <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">\n- <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">\n+def blastContigs(test_name,database):\n+ print(test_name)\n+ print(database)\n+ #db_path = os.path.dirname(os.path.realpath(__file__))+database\n+ db_path = database\n+ argString = "blastn -db "+db_path+" -query "+test_name+".fa -outfmt 10 -out "+test_name+"_blast.txt"\n+ print(argString)\n+ returncode = subprocess.call(argString, shell = True)\n+ if returncode != 0:\n+ return "Error in blastall"\n+ blast_df = pd.read_csv(""+test_name+"_blast.txt")\n+ #print (blast_df)\n+ #if ($temp[2] >= 98 & & $temp[3] > 100 & & $temp[10] < 0.001){\n+ #\'qaccver saccver pident length mismatch gapopen qstart qend sstart send evalue bitscore\'\n+ blast_df.columns = [\'qaccver\', \'saccver\', \'pident\', \'length\', \'mismatch\', \'gapopen\', \'qstart\', \'qend\', \'sstart\', \'send\', \'evalue\',\'bitscore\']\n+ blastResult_df = blast_df[(blast_df[\'pident\']>=98) & (blast_df[\'length\'] > 100) & (blast_df[\'evalue\']<0.001) ]\n+ blastResult_df = blastResult_df[[\'qaccver\', \'saccver\', \'pident\']] #query accession.version, subject accession.version, Percentage of identical matches\n+\n+ return blastResult_df\n \n \n \n- <link crossorigin="anonymous" media="all" integrity="sha512-3'..b'a-click="Footer, go to about, text:about" href="https://github.com/about">About</a></li>\n-\n- </ul>\n- </div>\n- <div class="d-flex flex-justify-center pb-6">\n- <span class="f6 text-gray-light"></span>\n- </div>\n-</div>\n-\n-\n-\n- <div id="ajax-error-message" class="ajax-error-message flash flash-error">\n- <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg>\n- <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error">\n- <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg>\n- </button>\n- You can\xe2\x80\x99t perform that action at this time.\n- </div>\n-\n-\n- <script crossorigin="anonymous" integrity="sha512-EPrD+nddbyhpiLL8l3M8VfJpZr4J2EWQLaPXZ+6A3VDJKzS5HeZ3dkMVieHSdvIPHsMbWPyVlY42SWKoS4XTfA==" type="application/javascript" src="https://github.githubassets.com/assets/compat-bootstrap-831f12d4.js"></script>\n- <script crossorigin="anonymous" integrity="sha512-oFBEYscCdWEyvUQehaYyaCSiKtIN4UvpfFHNpIXLUTSQ35JcacPNj86R8fgJfI1e7BOjbLZPTv1nJg3TECiMLw==" type="application/javascript" src="https://github.githubassets.com/assets/frameworks-7af24171.js"></script>\n- \n- <script crossorigin="anonymous" async="async" integrity="sha512-b9BDH7EZq1yaR2fUH08I378zVkToScLiQ//L0gdyPviliuwpWiVFkB8uW0K8zZszdeLeBpib7wGBLkPiIFgyHg==" type="application/javascript" src="https://github.githubassets.com/assets/github-bootstrap-2a8c2b54.js"></script>\n- \n- \n- \n- <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner" hidden\n- >\n- <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg>\n- <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>\n- <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>\n- </div>\n- <template id="site-details-dialog">\n- <details class="details-reset details-overlay details-overlay-dark lh-default text-gray-dark hx_rsm" open>\n- <summary role="button" aria-label="Close dialog"></summary>\n- <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal">\n- <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog>\n- <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg>\n- </button>\n- <div class="octocat-spinner my-6 js-details-dialog-spinner"></div>\n- </details-dialog>\n- </details>\n-</template>\n-\n- <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0">\n- <div class="Popover-message Popover-message--bottom-left Popover-message--large Box box-shadow-large" style="width:360px;">\n- </div>\n-</div>\n-\n- <div aria-live="polite" class="js-global-screen-reader-notice sr-only"></div>\n-\n- </body>\n-</html>\n-\n' |