comparison RepEnrich_setup.py @ 11:6bba3e33c2e7 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/repenrich commit 11df9f0b68d35d3a9424a17e4cefee6cfb9d4c19
author artbio
date Sat, 09 Mar 2024 22:32:46 +0000
parents f6f0f1e5e940
children 89e05f831259
comparison
equal deleted inserted replaced
10:6f4143893463 11:6bba3e33c2e7
5 import shlex 5 import shlex
6 import subprocess 6 import subprocess
7 import sys 7 import sys
8 8
9 from Bio import SeqIO 9 from Bio import SeqIO
10 from Bio.Alphabet import IUPAC
11 from Bio.Seq import Seq 10 from Bio.Seq import Seq
12 from Bio.SeqRecord import SeqRecord 11 from Bio.SeqRecord import SeqRecord
13 12
14 parser = argparse.ArgumentParser(description=''' 13 parser = argparse.ArgumentParser(description='''
15 Part I: Prepartion of repetive element psuedogenomes and repetive\ 14 Part I: Prepartion of repetive element psuedogenomes and repetive\
240 metagenome = metagenome + spacer + genome[chr][rstart:(rend+1)] 239 metagenome = metagenome + spacer + genome[chr][rstart:(rend+1)]
241 except KeyError: 240 except KeyError:
242 print("Unrecognised Chromosome: "+chr) 241 print("Unrecognised Chromosome: "+chr)
243 pass 242 pass
244 # Convert metagenome to SeqRecord object (required by SeqIO.write) 243 # Convert metagenome to SeqRecord object (required by SeqIO.write)
245 record = SeqRecord(Seq(metagenome, IUPAC.unambiguous_dna), id="repname", 244 record = SeqRecord(Seq(metagenome), id="repname",
246 name="", description="") 245 name="", description="")
247 print("saving repgenome " + newname + ".fa" + " (" + str(k) + " of " 246 print("saving repgenome " + newname + ".fa" + " (" + str(k) + " of "
248 + str(nrepgenomes) + ")") 247 + str(nrepgenomes) + ")")
249 fastafilename = os.path.realpath(setup_folder + os.path.sep 248 fastafilename = os.path.realpath(setup_folder + os.path.sep
250 + newname + ".fa") 249 + newname + ".fa")