Skip to content

Commit

Permalink
superfluous sorted()
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed Jan 24, 2025
1 parent 5748625 commit cb436b4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/jcvi/projects/sugarcane.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,7 @@ def mate_nplusn(self, name: str, other_genome: "Genome", verbose: bool = True):
print(
f"Crossing '{self.name}' x '{other_genome.name}' (n+n)", file=sys.stderr
)
f1_chromosomes = sorted(
self.gamete.chromosomes + other_genome.gamete.chromosomes
)
f1_chromosomes = self.gamete.chromosomes + other_genome.gamete.chromosomes
return Genome.make(name, f1_chromosomes)

def mate_nx2plusn(self, name: str, other_genome: "Genome", verbose: bool = True):
Expand All @@ -318,7 +316,7 @@ def mate_nx2plusn(self, name: str, other_genome: "Genome", verbose: bool = True)
)
gamete = self.gamete.chromosomes
duplicate = [x.duplicate() for x in gamete]
f1_chromosomes = sorted(gamete + duplicate + other_genome.gamete.chromosomes)
f1_chromosomes = gamete + duplicate + other_genome.gamete.chromosomes
return Genome.make(name, f1_chromosomes)

def mate_2nplusn_FDR(self, name: str, other_genome: "Genome", verbose: bool = True):
Expand All @@ -327,9 +325,7 @@ def mate_2nplusn_FDR(self, name: str, other_genome: "Genome", verbose: bool = Tr
f"Crossing '{self.name}' x '{other_genome.name}' (2n+n_FDR)",
file=sys.stderr,
)
f1_chromosomes = sorted(
self.gamete_fdr.chromosomes + other_genome.gamete.chromosomes
)
f1_chromosomes = self.gamete_fdr.chromosomes + other_genome.gamete.chromosomes
return Genome.make(name, f1_chromosomes)

def mate_2nplusn_SDR(self, name: str, other_genome: "Genome", verbose: bool = True):
Expand Down

0 comments on commit cb436b4

Please sign in to comment.