Previous changeset 2:073a2965e3b2 (2018-04-06) |
Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/pep_pointer commit 494bc6dd87b9a6e2af40cb32aa5d2ee6e9bfebfc |
modified:
pep_pointer.py pep_pointer.xml |
b |
diff -r 073a2965e3b2 -r a6282baa8c6f pep_pointer.py --- a/pep_pointer.py Fri Apr 06 18:13:10 2018 -0400 +++ b/pep_pointer.py Mon Jun 20 13:59:52 2022 +0000 |
[ |
b'@@ -1,10 +1,10 @@\n \n-# \n+#\n # Author: Praveen Kumar\n-# Updated: April 6th, 2018\n-# \n-# \n-# \n+# Updated: April 6th, 2018 (updated to python3: May 2022)\n+#\n+#\n+#\n \n import re\n \n@@ -15,7 +15,7 @@\n inputFile = sys.argv\n infh = open(inputFile[1], "r")\n # infh = open("Mus_musculus.GRCm38.90.chr.gtf", "r")\n- \n+\n gtf = {}\n gtf_transcript = {}\n gtf_gene = {}\n@@ -38,12 +38,12 @@\n start = a[4].strip()\n end = a[3].strip()\n else:\n- print "Please check the start end coordinates in the GTF file"\n+ print("Please check the start end coordinates in the GTF file")\n else:\n- print "Please check the strand information in the GTF file. It should be \'+\' or \'-\'."\n- if not gtf.has_key(strand):\n+ print("Please check the strand information in the GTF file. It should be \'+\' or \'-\'.")\n+ if strand not in gtf:\n gtf[strand] = {}\n- if not gtf[strand].has_key(type):\n+ if type not in gtf[strand]:\n gtf[strand][type] = []\n b = re.search("gene_id \\"(.+?)\\";", a[8].strip())\n gene = b.group(1)\n@@ -54,43 +54,41 @@\n transcript = b.group(1)\n data = (chr, start, end, gene, transcript, strand, type)\n gtf[strand][type].append(data)\n- \n+\n if type == "exon":\n- if gtf_transcript.has_key(chr+"#"+strand):\n- if gtf_transcript[chr+"#"+strand].has_key(transcript+"#"+gene):\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene][0].append(int(start))\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene][1].append(int(end))\n+ if chr + "#" + strand in gtf_transcript:\n+ if transcript + "#" + gene in gtf_transcript[chr + "#" + strand]:\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene][0].append(int(start))\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene][1].append(int(end))\n else:\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene] = [[],[]]\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene][0].append(int(start))\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene][1].append(int(end))\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene] = [[], []]\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene][0].append(int(start))\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene][1].append(int(end))\n else:\n- gtf_transcript[chr+"#"+strand] = {}\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene] = [[],[]]\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene][0].append(int(start))\n- gtf_transcript[chr+"#"+strand][transcript+"#"+gene][1].append(int(end))\n- \n+ gtf_transcript[chr + "#" + strand] = {}\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene] = [[], []]\n+ gtf_transcript[chr + "#" + strand][transcript + "#" + gene][0].append(int(start))\n+ gtf_transcript[chr + "#'..b'+" and end >= "+pep_end+" and strand = \'"+strand+"\' ")\n+ c.execute("select * from gtf_data where type = \'five_prime_utr\' and chr = \'" + chr + "\' and start <= " + pep_start + " and end >= " + pep_end + " and strand = \'" + strand + "\' ")\n rows = c.fetchall()\n if len(rows) > 0:\n outfh.write(each.strip() + "\\tfive_prime_utr\\n")\n else:\n- c.execute("select * from gtf_data where type = \'three_prime_utr\' and chr = \'"+chr+"\' and start <= "+pep_start+" and end >= "+pep_end+" and strand = \'"+strand+"\' ")\n+ c.execute("select * from gtf_data where type = \'three_prime_utr\' and chr = \'" + chr + "\' and start <= " + pep_start + " and end >= " + pep_end + " and strand = \'" + strand + "\' ")\n rows = c.fetchall()\n if len(rows) > 0:\n outfh.write(each.strip() + "\\tthree_prime_utr\\n")\n else:\n- c.execute("select * from gtf_data where type = \'exon\' and chr = \'"+chr+"\' and start <= "+pep_start+" and end >= "+pep_end+" and strand = \'"+strand+"\' ")\n+ c.execute("select * from gtf_data where type = \'exon\' and chr = \'" + chr + "\' and start <= " + pep_start + " and end >= " + pep_end + " and strand = \'" + strand + "\' ")\n rows = c.fetchall()\n if len(rows) > 0:\n outfh.write(each.strip() + "\\texon\\n")\n else:\n- c.execute("select * from gtf_data where type = \'intron\' and chr = \'"+chr+"\' and start <= "+pep_start+" and end >= "+pep_end+" and strand = \'"+strand+"\' ")\n+ c.execute("select * from gtf_data where type = \'intron\' and chr = \'" + chr + "\' and start <= " + pep_start + " and end >= " + pep_end + " and strand = \'" + strand + "\' ")\n rows = c.fetchall()\n if len(rows) > 0:\n outfh.write(each.strip() + "\\tintron\\n")\n else:\n- c.execute("select * from gtf_data where type = \'gene\' and chr = \'"+chr+"\' and start <= "+pep_start+" and end >= "+pep_end+" and strand = \'"+strand+"\' ")\n+ c.execute("select * from gtf_data where type = \'gene\' and chr = \'" + chr + "\' and start <= " + pep_start + " and end >= " + pep_end + " and strand = \'" + strand + "\' ")\n rows = c.fetchall()\n if len(rows) > 0:\n outfh.write(each.strip() + "\\tgene\\n")\n else:\n- c.execute("select * from gtf_data where type = \'intergenic\' and chr = \'"+chr+"\' and start <= "+pep_start+" and end >= "+pep_end+" and strand = \'"+strand+"\' ")\n+ c.execute("select * from gtf_data where type = \'intergenic\' and chr = \'" + chr + "\' and start <= " + pep_start + " and end >= " + pep_end + " and strand = \'" + strand + "\' ")\n rows = c.fetchall()\n if len(rows) > 0:\n outfh.write(each.strip() + "\\tintergene\\n")\n@@ -211,17 +204,13 @@\n outfh.write(each.strip() + "\\tSpliceJunction\\n")\n else:\n outfh.write(each.strip() + "\\tPlease check\\n")\n- \n+\n conn.close()\n outfh.close()\n else:\n- print "USAGE: python pep_pointer.py <input GTF file> <input tblastn file> <name of output file>"\n+ print("USAGE: python pep_pointer.py <input GTF file> <input tblastn file> <name of output file>")\n return None\n \n+\n if __name__ == "__main__":\n main()\n-\n-\n-\n-\n-\n' |
b |
diff -r 073a2965e3b2 -r a6282baa8c6f pep_pointer.xml --- a/pep_pointer.xml Fri Apr 06 18:13:10 2018 -0400 +++ b/pep_pointer.xml Mon Jun 20 13:59:52 2022 +0000 |
[ |
@@ -1,7 +1,7 @@ -<tool id="pep_pointer" name="PepPointer" version="0.1.3"> +<tool id="pep_pointer" name="PepPointer" version="0.1.3+galaxy1"> <description>classify genomic location of peptides</description> <requirements> - <requirement type="package" version="2.7.9">python</requirement> + <requirement type="package" version="3.7.9">python</requirement> </requirements> <command detect_errors="aggressive"><![CDATA[ #if $gtf_input.gtf_source == "cached": |