yxcompgen
Xu Yuxing's personal comparative genomics tools
Installation
pip install yxcompgen
Usage
Example for orthogroups analysis
orthogroups tsv file: The format which OrthoFinder outputs (Orthogroups.tsv), with the first column as orthogroup ID and the rest columns as gene IDs from different species, separated by tab (\t) and gene IDs separated by a comma and a space (, ). File have a header line, which first column is Orthogroup and the rest columns are species names.
read a orthogroups file:
from yxcompgen import OrthoGroups
OGs = OrthoGroups(OG_tsv_file="/path/to/Orthogroups.tsv")
# get orthogroup information
OGs.get(('OG0000000', 'Ath'))
species info file: An Excel file with columns sp_id, taxon_id, species_name, genome_file, gff_file, pt_file, cDNA_file, cds_file. sp_id is the species ID, taxon_id is the taxon ID, species_name is the species name, genome_file is the genome file path, gff_file is the GFF file path, pt_file is the protein sequence file path, cDNA_file is the cDNA sequence file path, cds_file is the CDS sequence file path.
read a species info file:
from yxcompgen import read_species_info
ref_xlsx = '/path/to/species_info.xlsx'
sp_info_dict = read_species_info(ref_xlsx)
Example for synteny blocks building
- input: gff file and gene pair file
gff file should be in gff3 format, and gene pair file should be a tab-delimited file with two columns, each row is a gene pair from two species.
Cca_Gene1 Sly_Gene1
Cca_Gene2 Sly_Gene2
...
sp1_id = 'Cca'
sp1_gff = '/path/to/Cca.gff3'
sp2_id = 'Sly'
sp2_gff = '/path/to/Sly.gff3'
gene_pair_file = '/path/to/gene_pair.txt'
- build synteny blocks
from yxcompgen import GenomeSyntenyBlockJob
sb_job = GenomeSyntenyBlockJob(
sp1_id, sp1_gff, sp2_id, sp2_gff, gene_pair_file)
sb_job.build_synteny_blocks()
- write synteny blocks to file
output file is in MCScan format
mcscan_output_file = "/path/to/collinearity_output.txt"
sb_job.write_mcscan_output(mcscan_output_file)
- Or you can read synteny blocks from file
sb_job = GenomeSyntenyBlockJob(
sp1_id, sp1_gff, sp2_id, sp2_gff)
sb_job.read_mcscan_output(mcscan_output_file)
- You can also work with only one genome
sb_job = GenomeSyntenyBlockJob(
sp1_id, sp1_gff, gene_pair_file=gene_pair_file)
Example for synteny blocks plot
sb_job.plot()
highlight_sb_list = [65, 178, 237, 331]
sb_job.plot(mode='loci', reverse=True, highlight_synteny_blocks=highlight_sb_list)
Metadata
Release files for yxcompgen 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yxcompgen-0.0.1.tar.gz | 71.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yxcompgen-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 145.7 kB
Release files / yxcompgen-0.0.1.tar.gz
| Download URL | yxcompgen-0.0.1.tar.gz |
|---|---|
| Size | 71.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8999fe841da5aca881c19f19fc20c5653d7a6bc6158cf6965c05e069b4184f78
|
|
BLAKE2b-256 checksum How to use checksums |
ecb81bf4a95e66a1ab330d5dce87f5e6809e968c6e3e32ce6d2baf028cb6401f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.7
|
Release files / yxcompgen-0.0.1-py3-none-any.whl
| Download URL | yxcompgen-0.0.1-py3-none-any.whl |
|---|---|
| Size | 74.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
857e311bf4830fa059b3a7f11783058ac6ab5ec1d46a4016761d81f188c3b4af
|
|
BLAKE2b-256 checksum How to use checksums |
731928a0fea799458ae64bbcc2a9cae2678445277ef343fa25f6f70002a1e672
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.7
|