Commit 1ba3eff4 authored by jedlickap's avatar jedlickap
Browse files

add updated scripts

parent 343f63fc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ class RetroTeDomains(ToolInterface):
        
        retro_domains = self._filter_candidates(candidates)

        retro_domains.sort(key=lambda e: e.location[0])
        retro_domains.sort(key=lambda e: e.location[0], reverse=True)
        self.output_object = RetroDomainOutputObject(self.seqId, sequence, retro_domains)
        return retro_domains

@@ -45,8 +45,12 @@ class RetroTeDomains(ToolInterface):
        retro_domains = []
        # filter on matches with evalue 0.1 and lower
        candidates = [candidate for candidate in candidates if candidate.evalue <= 0.1]
        
        for c in candidates:
            c.location.sort()
        
        # sort after location and score
        candidates.sort(key=lambda e: (e.location, -e.score))
        candidates.sort(key=lambda e: (e.location[0], -e.score))
        for candidate in candidates:
            add = True
            for domain in retro_domains:
+5 −1
Original line number Diff line number Diff line
@@ -12,6 +12,11 @@ class RetroDomainOutputGenerator(BaseOutputGenerator):
    def generate_output(self, output_object: RetroDomainOutputObject) -> NoReturn:
        self.create_data_directory(output_object.sequence_id)
        
        # sort elements after location[0]
        for element in output_object.elements:
            element.location = [min(element.location), max(element.location)]
        output_object.elements.sort(key=lambda e: e.location[0])

        with open(f"{self.directory}/{output_object.sequence_id}/{output_object.sequence_id}_retro_domain.gff", "w+") as gff:
            i = 0
            gff.write("##gff-version 3\n")
@@ -20,7 +25,6 @@ class RetroDomainOutputGenerator(BaseOutputGenerator):
                sign = (lambda x: x and (1, -1)[x < 0])(domain.frame[0])
                strand = "+"
                if sign < 0:
                    domain_location = [domain_location[1], domain_location[0]]
                    strand = '-'                
                gff.write(output_object.sequence_id + "\t"
                          + "retroTeDomain\tpolypeptide_conserved_region\t"
+2 −2

File changed.

Contains only whitespace changes.