Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __eq__(self, other):
return (
other.__class__ is EnsemblRelease and
self.release == other.release and
self.species == other.species)
def all_combinations_of_ensembl_genomes(args):
"""
Use all combinations of species and release versions specified by the
commandline arguments to return a list of EnsemblRelease or Genome objects.
The results will typically be of type EnsemblRelease unless the
--custom-mirror argument was given.
"""
species_list = args.species if args.species else ["human"]
release_list = args.release if args.release else [MAX_ENSEMBL_RELEASE]
genomes = []
for species in species_list:
# Otherwise, use Ensembl release information
for version in release_list:
ensembl_release = EnsemblRelease(version, species=species)
if not args.custom_mirror:
genomes.append(ensembl_release)
else:
# if we're using a custom mirror then we expect the provided
# URL to be a directory with all the same filenames as
# would be provided by Ensembl
gtf_url = os.path.join(
args.custom_mirror,
os.path.basename(ensembl_release.gtf_url))
transcript_fasta_urls = [
os.path.join(
args.custom_mirror,
os.path.basename(transcript_fasta_url))
for transcript_fasta_url in ensembl_release.transcript_fasta_urls
]
def collect_all_installed_ensembl_releases():
genomes = []
for (species, release) in Species.all_species_release_pairs():
genome = EnsemblRelease(release, species=species)
if genome.required_local_files_exist():
genomes.append(genome)
return sorted(genomes, key=lambda g: (g.species.latin_name, g.release))