Skip to content

Commit 03183e2

Browse files
authored
Merge pull request #685 from ARTbio/syncho_repenrich
back propagate repenrich2 improvement to repenrich
2 parents 6b3b119 + 5608a6f commit 03183e2

File tree

5 files changed

+6
-422
lines changed

5 files changed

+6
-422
lines changed

tools/repenrich/RepEnrich_setup.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def import_text(filename, separator):
7171
genome = defaultdict(dict)
7272

7373
for chr in g.keys():
74-
genome[chr]['sequence'] = g[chr].seq
74+
genome[chr]['sequence'] = str(g[chr].seq)
7575
genome[chr]['length'] = len(g[chr].seq)
7676

7777
# Build a bedfile of repeatcoordinates to use by RepEnrich region_sorter
@@ -100,7 +100,7 @@ def import_text(filename, separator):
100100

101101
# generate metagenomes and save them to FASTA files for bowtie build
102102
for repname in rep_coords:
103-
metagenome = ''
103+
genomes_list = []
104104
# iterating coordinate list by block of 3 (chr, start, end)
105105
block = 3
106106
for i in range(0, len(rep_coords[repname]) - block + 1, block):
@@ -109,11 +109,8 @@ def import_text(filename, separator):
109109
start = max(int(batch[1]) - flankingl, 0)
110110
end = min(int(batch[2]) + flankingl,
111111
int(genome[chromosome]['length'])-1) + 1
112-
metagenome = (
113-
f"{metagenome}{spacer}"
114-
f"{genome[chromosome]['sequence'][start:end]}"
115-
)
116-
112+
genomes_list.append(genome[chromosome]['sequence'][start:end])
113+
metagenome = spacer.join(genomes_list)
117114
# Create Fasta of repeat pseudogenome
118115
fastafilename = f"{repname}.fa"
119116
record = SeqRecord(Seq(metagenome), id=repname, name='', description='')

tools/repenrich/macros.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<macros>
22
<token name="@TOOL_VERSION@">2.31.1</token>
3-
<token name="@VERSION_SUFFIX@">1</token>
3+
<token name="@VERSION_SUFFIX@">2</token>
44
<token name="@PROFILE@">23.0</token>
55

66
<xml name="repenrich_requirements">

tools/repenrich/repenrich.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#end if
3535
#end if
3636
ln -f -s '$genome' 'genome.fa' &&
37-
bowtie-build '$genome' genome &&
37+
bowtie-build --threads \${GALAXY_SLOTS:-1} '$genome' genome &&
3838
python $__tool_directory__/RepEnrich_setup.py
3939
--annotation_file '$repeatmasker'
4040
--genomefasta 'genome.fa'

0 commit comments

Comments
 (0)