Skip to content

Commit 907656d

Browse files
committed
Merge branch 'rf-roothog-inference' into dev
2 parents 5e26769 + 20aa57c commit 907656d

File tree

9 files changed

+360
-351
lines changed

9 files changed

+360
-351
lines changed

.github/workflows/docker-image.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,21 @@ jobs:
6565
username: ${{ secrets.DOCKER_HUB_USERNAME }}
6666
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
6767

68+
- name: Set platforms
69+
id: set_platforms
70+
run: |
71+
echo "github ref: ${GITHUB_REF}"
72+
if [[ "${GITHUB_REF##*/}" == "main" || "${GITHUB_REF##*/}" == "dev" ]]; then
73+
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
74+
else
75+
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
76+
fi
77+
6878
- name: Build and push
6979
uses: docker/build-push-action@v6
7080
with:
7181
context: .
72-
platforms: linux/amd64,linux/arm64
82+
platforms: ${{ steps.set_platforms.outputs.platforms }}
7383
push: true
7484
#${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
7585
tags: ${{ steps.meta.outputs.tags }}

FastOMA/_utils_roothog.py

Lines changed: 188 additions & 247 deletions
Large diffs are not rendered by default.

FastOMA/check_input.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,11 @@ def check_splice(isoform_by_gene_all):
202202

203203
logger.debug("For "+str(spliced_species_num)+" species, out of "+str(len(isoform_by_gene_all))+" , we have splice files.")
204204
if total_genes ==0:
205-
logger.debug("No splice information found. It could be that each line of splice files has only one item. Make sure that the splitter in each line is semicolon ; . Or the splice folder is empty. You need to delete the empty splice folder. FastOMA check input failed! Exiting...")
205+
logger.error("No splice information found. It could be that each line of splice files has only one item. Make sure that the splitter in each line is semicolon ; . Or the splice folder is empty. You need to delete the empty splice folder. FastOMA check input failed! Exiting...")
206206
sys.exit(1)
207207

208208
logger.debug("In total, for "+ str(total_genes)+" genes, we have " + str(total_isoforms)+" splices.")
209209

210-
# make sys back
211-
return 1
212-
213210

214211
def fastoma_check_input():
215212
import argparse
@@ -275,7 +272,7 @@ def fastoma_check_input():
275272
splice_files = conf.splice is not None and os.path.exists(conf.splice)
276273
if splice_files:
277274
logger.debug("splice folder exist. Let's see its inside.")
278-
isoform_by_gene_all = _utils_roothog.parse_isoform_file(species_names, conf.splice)
275+
isoform_by_gene_all = _utils_roothog.parse_isoform_files(species_names, conf.splice)
279276
check_splice(isoform_by_gene_all)
280277
else:
281278
logger.info("Splice folder doesn't exist and that's ok.")

FastOMA/collect_subhogs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,11 @@ def write_hog_orthoxml(pickle_folder, output_xml_name, gene_id_pickle_file, id_t
178178
species_xml = ET.SubElement(orthoxml_file, "species", attrib={"name": query_species_name, "taxonId": str(name2taxid[query_species_name]), "NCBITaxId": "0"})
179179
database_xml = ET.SubElement(species_xml, "database", attrib={"name": "database", "version": "2023"})
180180
genes_xml = ET.SubElement(database_xml, "genes")
181-
for (gene_idx_integer, query_prot_name) in list_prots:
182-
prot_id = id_transformer.transform(query_prot_name)
183-
gene_xml = ET.SubElement(genes_xml, "gene", attrib={"id": str(gene_idx_integer), "protId": prot_id})
181+
for gene in list_prots:
182+
attribs = {"id": str(gene.numeric_id), "protId": id_transformer.transform(gene.prot_id)}
183+
if gene.main_isoform is not None:
184+
attribs["main_isoform"] = str(gene.main_isoform)
185+
gene_xml = ET.SubElement(genes_xml, "gene", attrib=attribs)
184186
logger.debug("gene_xml is created.")
185187
orthoxml_file.append(taxonomy)
186188

0 commit comments

Comments
 (0)