Skip to content

Commit

Permalink
Merge pull request #685 from ARTbio/syncho_repenrich
Browse files Browse the repository at this point in the history
back propagate repenrich2 improvement to repenrich
  • Loading branch information
drosofff authored Apr 21, 2024
2 parents 6b3b119 + 5608a6f commit 03183e2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 422 deletions.
11 changes: 4 additions & 7 deletions tools/repenrich/RepEnrich_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def import_text(filename, separator):
genome = defaultdict(dict)

for chr in g.keys():
genome[chr]['sequence'] = g[chr].seq
genome[chr]['sequence'] = str(g[chr].seq)
genome[chr]['length'] = len(g[chr].seq)

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

# generate metagenomes and save them to FASTA files for bowtie build
for repname in rep_coords:
metagenome = ''
genomes_list = []
# iterating coordinate list by block of 3 (chr, start, end)
block = 3
for i in range(0, len(rep_coords[repname]) - block + 1, block):
Expand All @@ -109,11 +109,8 @@ def import_text(filename, separator):
start = max(int(batch[1]) - flankingl, 0)
end = min(int(batch[2]) + flankingl,
int(genome[chromosome]['length'])-1) + 1
metagenome = (
f"{metagenome}{spacer}"
f"{genome[chromosome]['sequence'][start:end]}"
)

genomes_list.append(genome[chromosome]['sequence'][start:end])
metagenome = spacer.join(genomes_list)
# Create Fasta of repeat pseudogenome
fastafilename = f"{repname}.fa"
record = SeqRecord(Seq(metagenome), id=repname, name='', description='')
Expand Down
2 changes: 1 addition & 1 deletion tools/repenrich/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">2.31.1</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@VERSION_SUFFIX@">2</token>
<token name="@PROFILE@">23.0</token>

<xml name="repenrich_requirements">
Expand Down
2 changes: 1 addition & 1 deletion tools/repenrich/repenrich.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#end if
#end if
ln -f -s '$genome' 'genome.fa' &&
bowtie-build '$genome' genome &&
bowtie-build --threads \${GALAXY_SLOTS:-1} '$genome' genome &&
python $__tool_directory__/RepEnrich_setup.py
--annotation_file '$repeatmasker'
--genomefasta 'genome.fa'
Expand Down
Loading

0 comments on commit 03183e2

Please sign in to comment.