diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/ancestry_pca.md b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/ancestry_pca.md new file mode 100644 index 00000000..50560b77 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/ancestry_pca.md @@ -0,0 +1,19 @@ +# Bd isolate ordination (PCA) from SNP allele fractions (2026-11-14) + +Status: exploratory. Script `scripts/bd_snp_pca.py` (test in `tests/test_bd_coverage.py`); tables `tables/pca_scores.tsv`, `tables/pca_variance.tsv`. +Input: the 69 per-isolate SNP tables against CLFT044. Method: biallelic SNPs on the 14 scaffolds of 500 kb or more, DP >= 10 and within 0.5x to 2x of the +isolate's median depth, every 10th position, sites carried by 3 or more isolates and by at most 90% of isolates (15,804 sites). Entry = alternative-allele +fraction; an isolate with no SNP row at a site gets 0. Mean-centred, SVD. This is allele-fraction space, not a tree. + +## Result +- PC1 holds 47.3% of the variance (PC2 to PC4: 4.3, 2.8, 2.4%). It is the CLFT-type against JEL-type axis: CLFT-type isolates at +26 to +52, JEL-type mostly at -23 to -9. +- PC4 separates two isolates from all others: KRBOOR_331 (South Korea) and the Swiss isolate, both at about -31 (all others between -4 and +4). Both have high depth (171x and 81x), so this is not a depth effect. This is the third-lineage-like signal behind their low JEL423 recovery in the parent-of-origin analysis. +- CLFT160 (HET-rich; 26x) lies at PC1 +16.5, between the class centres (JEL-type median -17.1, CLFT-type median +51.4), about halfway, and at PC4 +2.2, so not on the Swiss/Korean axis. JEL-type isolates at similar depth (22 to 30x) lie at -21.8 to -7.1, so the position is not a depth effect. This agrees with a mixture of the CLFT-type and JEL-type lineages and does not fit the third lineage. +- CLFT039 (HET-rich; 15x) lies at PC1 +21.1 and PC4 -1.05. This position cannot be read: see the depth effect below. + +## The depth effect (a limit of this ordination) +A missing SNP row is scored as the reference allele, so low depth pulls an isolate toward the middle of PC1. Within the JEL-type class, depth and PC1 correlate with Spearman rho = -0.78 (n = 52). JEL-type isolates of 17x or less have a median PC1 of -1.2 (range -8.6 to +23.6) against -17.6 at 25 to 35x and -20.8 at 60x or more. CLFT039 (15x) falls inside the range of those low-depth isolates, so the ordination does not separate it from them; six other isolates of 13 to 16x sit between the class centres for the same reason and are not evidence of mixture. + +## What this does not show +- A tree, a formal ancestry model (no admixture proportions), or a third-lineage reference. The statement "the lineage mixture fits CLFT160 and not the Swiss/Korean third-lineage signal" rests on one isolate at adequate depth. +- Anything about CLFT039 beyond the parent-of-origin windows (see `report.md`), which are not depth-corrected either. diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/aneuploidy.md b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/aneuploidy.md new file mode 100644 index 00000000..df6b3153 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/aneuploidy.md @@ -0,0 +1,36 @@ +# Bd chromosome depth changes and allele balance (2026-11-14) + +Status: exploratory; nothing is curated. Source: `bd_depth_by_seq_JEL423.tsv` (69 isolates against the 20-sequence JEL423 assembly, job set of +2026-11-13), scripts `scripts/bd_aneuploidy.py` and `scripts/bd_aneuploidy_af.py` (tests in `tests/test_bd_coverage.py`). Tables in `tables/`: +`aneuploidy_flags.tsv`, `aneuploidy_af.tsv`, `genomewide_allele_balance.tsv`, `aneuploidy_by_sequence.tsv`. + +## Method +Sequences of 500 kb or more (16 chromosomes). The depth ratio of a sequence (median depth over the genome median) is divided by the median ratio of the +same sequence over the isolate's lineage class (CLFT-type 15 isolates, JEL-type 52; the two HET-rich isolates are too few to form a class). This removes +lineage-specific offsets. An isolate-sequence is flagged when the normalised ratio is outside 1 +/- 0.25 and the isolate has a median depth of 20x or more. +Then, for each flag, the heterozygous SNPs (minor allele fraction 0.15 to 0.5) of that sequence are compared with those of the isolate's other chromosomes: +the share near 1/3 (0.27 to 0.40) and near 1/2 (0.43 to 0.50). An extra copy of a chromosome in a diploid should move sites from 1/2 to 1/3. + +## Result +- Population-wide offsets (not isolate-specific): median ratio 1.28 on CP161924.1 and 1.23 on CP161925.1 across all isolates, 0.77 on CP161938.1. They are properties of the reference or of the species relative to JEL423, not aneuploidy. The small sequences CP161939 to CP161942 (57 to 141 kb) have ratios of 0, 0, 3.9 and 0.73: repeats or organelles, excluded from the analysis. +- 48 isolate-sequence flags in 28 of 69 isolates: 35 gains (norm > 1) and 13 losses; 10 gains at 1.4 or more, 2 losses at about 0.52. +- Gains (24 with norm 1.3 or more): 15 show the allele-balance shift (1/3 share up and 1/2 share down by more than 0.1 against the isolate's other chromosomes); 9 do not. The clearest cases are in high-depth isolates (50x or more): L2203 CP161926.1 (ratio 1.46; 66% of het sites near 1/3 against 22.5% on other chromosomes, 7% near 1/2 against 50%), KRBOOR_331 CP161926.1 (1.45; 76% against 22%) and RTP5 CP161931.1 (1.38; 68% against 24%). That is the signature of one extra copy of one chromosome in a diploid isolate. The same isolates have 50 to 57% of het sites near 1/2 on their other chromosomes, which is the diploid pattern. +- CLFT065 CP161936.1 (ratio 1.59, 55x) shows the opposite shift (53% of het sites near 1/2 against 30% on the rest), so it is not the trisomy pattern; I cannot say what it is (a duplication, or a different copy state). +- Losses (7 with norm 0.7 or less): in 4 the het SNP density on the flagged chromosome is below 0.75 of the rest, as expected when one copy is lost (CLFT078 and CLFT166 CP161938.1 at ratio about 0.52: 831 and 698 het per Mb against 1,866 and 1,078). +- CP161926.1 is gained in 6 isolates from different lineage classes and countries (Montserrat L2203, South Korea KRBOOR_331, Sweden, and three Brazilian isolates); CP161936.1, CP161937.1 and CP161931.1 are gained in 4 isolates each. I did not test whether these gains are shared by descent. +- Isolates with several flagged chromosomes: CLFT065 (5), CLFT080, CLFT156, CLFT165, CLFT167 (3 each) and the "Generic sample" from Switzerland (4). I did not examine them further. + +## What this does not show +- A baseline ploidy for each isolate. The genome-wide allele balance puts 21 isolates in a "third-dominated" group, 15 "half-dominated" and 33 "mixed", but this label is confounded: the third-dominated isolates have a median depth of 21x against 105x for half-dominated ones. At low depth the allele fractions are noisy and reference divergence skews them, so I do not read the label as triploidy. Only the within-isolate comparison (flagged chromosome against the same isolate's other chromosomes) is controlled for depth. +- A whole-genome ploidy change is invisible in a ratio to the genome median. +- The 20x cutoff leaves noise at the lowest depths; 10 isolates are below 20x and were not flagged. +- The two HET-rich isolates are covered in the next section; CLFT039 has a median depth of 16.2x, below the 20x cutoff, so it cannot be flagged. + +## The two HET-rich isolates (CLFT160 = SRR10698391, CLFT039 = SRR10698425): hybrid-like or aneuploid? +`scripts/bd_aneuploidy.py --fallback-class JEL-type` compares them with the JEL-type median (two isolates cannot form a class; the JEL-type baseline is a rough +reference). `scripts/bd_hetrich_check.py` gives per-sequence depth, allele balance (JEL423 reference) and parent-of-origin window classes (CLFT044 reference). +Tables: `aneuploidy_flags_with_hetrich.tsv`, `hetrich_by_sequence.tsv`. +- Depth: CLFT160 has two gain flags (CP161931.1 at 1.32 and CP161936.1 at 1.38 against the JEL-type median); CLFT039 (16.2x) is below the flag cutoff, and its ratios lie between 0.77 and 1.24. Neither isolate has a loss flag. +- Parent-of-origin windows on the 14 scaffolds of 500 kb or more: heterozygous windows (JEL423 and CLFT044 alleles both present) are the majority on almost all of them: median share 0.70 in CLFT160 and 0.72 in CLFT039. In CLFT039 the share is 0.47 or more on every scaffold; in CLFT160 it is 0.40 or more on 12 of 14. The two exceptions are JAQIHF010000010.1 (share 0.105; 32% CLFT windows) and JAQIHF010000014.1 (share 0.000; 50% CLFT windows); their depth is normal (0.99, 0.93), so they are not copy-number changes. Windows homozygous for the JEL423 allele are almost absent (median share 0.01 and 0.05); CLFT-class windows are 29% and 20%. +- So the heterozygosity of both isolates is genome-wide and is not tied to a gained chromosome: CLFT160's two gains are on scaffolds with ordinary HET shares. The pattern fits an isolate that carries both lineages in one genome with part of the genome homozygous for the CLFT044 allele (possible loss of heterozygosity on two scaffolds of CLFT160), and does not fit aneuploidy as the cause of the heterozygosity. +- Limits: the allele-balance columns of the same table (median 0.37 and 0.33 of het sites near 1/2) are at depths of 27.5x and 16.2x and are too noisy to read; the "hybrid" reading rests on the window classes, which depend on the 0.5 recovery cutoff set from two control isolates; a third lineage that shares alleles with both references would give the same pattern; the two isolates are the only ones of this type, so no comparison group exists. diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/figures/bd_summary.pdf b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/figures/bd_summary.pdf new file mode 100644 index 00000000..6efcaf69 Binary files /dev/null and b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/figures/bd_summary.pdf differ diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/figures/bd_summary.png b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/figures/bd_summary.png new file mode 100644 index 00000000..e22297da Binary files /dev/null and b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/figures/bd_summary.png differ diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/idiomorph_scan.md b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/idiomorph_scan.md new file mode 100644 index 00000000..d720a4e4 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/idiomorph_scan.md @@ -0,0 +1,28 @@ +# Bd cross-isolate depth scan for a mating-type idiomorph (2026-11-14) + +Status: negative result. No candidate idiomorph was found. Nothing here is curated. + +Script: `scripts/bd_idiomorph_scan.py` (tests in `tests/test_bd_coverage.py`). Input: the 10 kb window tables of 58 (CLFT044 +reference) and 59 (JEL423 reference) isolates with median depth of at least 20x. Genes come from the BFD funannotate GFF3 +(scaffold IDs identical to the references used). Tables: `tables/idiomorph_regions_.tsv`, `tables/idiomorph_null_.tsv`. + +## Method +Each window ratio is divided by its sequence median, which removes whole-sequence copy-number change. A window is FULL +(0.8 to 1.25), HALF (0.35 to 0.65) or LOW (below 0.25) per isolate. A candidate window has at least 5 FULL isolates and at least +3 LOW or HALF isolates. Neighbouring candidate windows merge; regions of 20 kb or more are kept. Expected signature of a +diploid idiomorph: FULL, HALF and LOW isolates in the same window, with few het SNPs in HALF isolates (only one copy aligns). + +## Result +- CLFT044 coordinates: 71 regions. JEL423 coordinates: 70 regions. +- Most regions are HALF in many isolates, with a median of 20 to 60 het SNPs per 10 kb window in those isolates. That fits + divergent sequence that maps poorly onto a reference of another lineage, not a hemizygous region. +- Regions with n_half >= 3 and median het in HALF isolates <= 3: 3 against CLFT044 and 5 against JEL423. None has a gene whose + product or note matches HMG, homeodomain, mating, sex or pheromone. HALF isolates in these regions come from both CLFT-type and + JEL-type groups, so lineage does not explain them. I did not examine their gene content further. +- The rotation null (each isolate rotated by a random offset, 100 permutations) gave a mean of 120 (CLFT044) and 110 (JEL423) + regions, more than observed. The region count is therefore not a usable test statistic, and I make no significance claim. + +## Limits +- No evidence that Bd has a two-idiomorph system. A scan like this assumes a presence/absence or hemizygous idiomorph. +- 10 kb windows. A small locus can be missed. Smaller windows need a new alignment, because no BAMs were kept. +- Isolates below 20x were dropped. Two of the references are from different lineages, which drives the HALF windows. diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/report.md b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/report.md new file mode 100644 index 00000000..6e464ead --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/report.md @@ -0,0 +1,101 @@ +# Batrachochytrium dendrobatidis: read depth, heterozygosity and parent of origin + +Status: exploratory analysis of public reads. Nothing here is curated or accepted. Bd isolates are diploid, and the +allele balance is read that way. + +Pipeline commit: `6bfc6a3cad`. Jobs: JEL423 reference 32070127 and 32070630 (array 2-9); CLFT044 reference 32070128 and +32070631; reference alignment 32089404 (minimap2 2.30, `-x asm10 -c --cs=short`). Result folder on the HPCC: +`results/2026-11-13_bd_coverage/` (not committed; tables below are copies). + +## Data + +- Runs: 69 runs analysed of 72 listed (Brazil 52, other countries 17), chosen from PopSeq + `catalog/runs/fungi_all_runs.csv.gz` (ENA snapshot 2026-11-06) and ENA. All were Illumina WGS. See `tables/bd_runs_popseq.tsv`. +- References: JEL423 (GCA_048537975.1) and UCR_BdCLFT044 (Brazil lineage per the curator). I did not verify the lineage of JEL423 here. +- Each run: `prefetch`, `fasterq-dump`, read-pair count checked against ENA `read_count`, `bwa-mem2`, duplicate removal, + `mosdepth` 10 kb windows (MAPQ 20), `bcftools` SNP calls (QUAL 30). +- Excluded runs (`tables/excluded_runs.tsv`): + - SRR13660529: mate2 7132682 vs ena 29477484 + - ERR14883802: mates 4218822 each; ena 8437644 (= 2x mate count) + +## 1. Depth and SNP density + +Median depth of the 69 isolates: 32.9x (range +10.8 to 178.6). 10 isolates have median depth below 20x; treat their numbers with more care. + +Isolates against their own reference (controls): + +| control | SNPs/Mb vs JEL423 | het fraction | SNPs/Mb vs CLFT044 | het fraction | +|---|---|---|---|---| +| CLFT044 reads | 5399.1 | 0.4391 | 1356.8 | 0.9345 | +| JEL423 reads | 1851.2 | 0.9264 | 4611.6 | 0.4079 | + +An isolate does not give near-zero SNPs against its own reference. Each reference is a haploid representation of a diploid +genome, so heterozygous sites are expected, and the het fraction is high (0.9). Repeats and paralogs can add het-like SNPs; +I did not separate the two causes. A het fraction alone therefore cannot call a hybrid. + +Depth flags: sequences of 200 kb or more with median depth outside 0.75 to 1.25 of the genome median occur in most isolates (0 to 11 per isolate) +(see `tables/bd_isolate_summary_*.tsv`, column `depth_flag_seqs`). I did not separate copy-number change from repeat or +assembly artefacts. Ploidy variation, including aneuploidy, is also known in Bd; I did not test it here. + +![SNP density and parent-of-origin summary](figures/bd_summary.png) [PDF](figures/bd_summary.pdf) + +Figure source: `tables/isolate_classes.tsv`, `tables/parent_origin_summary.tsv`; script `scripts/bd_report.py`. + +## 2. Parent of origin + +Method (`scripts/bd_parent_of_origin.py`): align JEL423 to CLFT044 and take single-base differences in primary alignments +(172,706 sites). In each isolate, a site is "called" when its CLFT044-reference SNP table has the JEL423 base. Per 50 kb +window: recovery = called sites / usable sites; het share = called sites with alt fraction 0.2 to 0.8. A window is `CLFT` +when recovery < 0.5, else `HET` when het share >= 0.5, else `JELHOM`. + +Why sites without a SNP row are not counted as CLFT044 allele: in the JEL423 isolate about a third of divergent sites have no row, +so absence is not evidence. I first counted them as CLFT044 and the JEL423 isolate then scored only 0.57 JEL fraction; that +version was dropped. + +Calibration: only two controls. In the CLFT044 isolate the window recovery has median 0.05 and 95th percentile 0.41. In the +JEL423 isolate the median is 0.87 and the 5th percentile 0.16. I set the cutoff at 0.5 from these. It is not validated on isolates +of known hybrid status. Isolate class: CLFT-type if over 60% CLFT windows, JEL-type if over 60% JELHOM windows, HET-rich if +over 50% HET windows, else mixed. + +| group | CLFT-type | JEL-type | HET-rich | mixed | +|---|---|---|---|---| +| Brazil (n=52) | 13 | 37 | 2 | 0 | +| Other countries (n=17) | 2 | 15 | 0 | 0 | + +Control isolates: CLFT044 is CLFT-type; JEL423 is JEL-type. + +### Isolates that are HET-rich or mixed + +| isolate | country | median depth | SNPs/Mb vs JEL423 | SNPs/Mb vs CLFT044 | recovery | het share of called | windows CLFT/HET/JELHOM | class | +|---|---|---|---|---|---|---|---|---| +| CLFT160 | Brazil | 27.5 | 4593.9 | 3939.5 | 0.5369 | 0.8059 | 152/277/28 | HET-rich | +| CLFT039 | Brazil | 16.2 | 3874.4 | 3429.5 | 0.5664 | 0.7422 | 102/292/38 | HET-rich | + +These isolates carry JEL423 alleles in most windows, mostly in one copy. That is the pattern expected for a first-generation +hybrid of the two lineages. It does not show that they are hybrids. Other explanations I did not exclude: a third lineage that shares +alleles with both references; aneuploidy; mapping effects at divergent sites. A hybrid call needs a tree or ancestry analysis and +a lineage reference beyond these two. Published context: a Bd-GPL x Bd-Brazil hybrid zone in the Serra da Graciosa, Parana (Jenkinson et al. 2016, +doi 10.1111/mec.13599). I did not compare my isolates with that study's samples. + +### Non-Brazil isolates that are CLFT-type + +| isolate | country | median depth | SNPs/Mb vs JEL423 | SNPs/Mb vs CLFT044 | recovery | het share of called | windows CLFT/HET/JELHOM | class | +|---|---|---|---|---|---|---|---|---| +| KRBOOR_331 | South Korea | 175.0 | 6472.1 | 5103.9 | 0.3672 | 0.4199 | 350/8/122 | CLFT-type | +| Generic sample from B. dendrobatis | Switzerland: Gamlikon | 86.2 | 5091.5 | 4115.0 | 0.3267 | 0.3347 | 377/1/95 | CLFT-type | + +Their recovery is 0.33 and 0.37, well below the JEL-type isolates (about 0.6 to 0.75). They carry few alleles of either reference. +A third lineage is a possible reason; I did not check their lineage. + +## Limits + +- Two references only. Lineage names are the curator's for CLFT044 and my understanding for JEL423. +- SNP tables keep QUAL >= 30 and no per-site depth was stored, so absence of a call cannot be told from no coverage. +- Window class is noisy: the CLFT044 control has windows with recovery up to 0.6. +- The Brazil set is 52 runs; PopSeq lists 58 Brazilian isolates, so the set is not all of them. + +## Next + +Add an ancestry or tree analysis with at least one more lineage reference (for example a BdASIA or BdCAPE assembly), and test +the HET-rich isolates for aneuploidy with allele balance by sequence. diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/site_genotypes.md b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/site_genotypes.md new file mode 100644 index 00000000..dd3d3fb2 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/site_genotypes.md @@ -0,0 +1,47 @@ +# Bd depth-controlled genotypes at the divergent sites (2026-11-14) + +Status: exploratory. Scripts `scripts/bd_site_genotype.slurm`, `bd_site_allele_counts.py`, `bd_site_summary.py` (tests in `tests/test_bd_coverage.py`); job array 32093759. +Tables: `tables/site_genotype_summary.tsv`, `tables/site_genotype_by_sequence.tsv`. + +## Why +The SNP-table analyses (parent of origin, ordination) score a missing SNP row as the reference allele, so low depth biases them (`ancestry_pca.md`: depth and PC1 +correlate at rho -0.78 in the JEL-type class). Here every isolate is re-mapped and downsampled to the same depth, and reads are counted at the same sites. + +## Method +Nine isolates were chosen: the two HET-rich isolates (CLFT160, CLFT039), CLFT165 (CLFT-type with an intermediate depth profile), CLFT044 (CLFT-type control, the +reference lineage) and five JEL-type isolates (CLFT130, CLFT120, CLFT088, CLFT166, CLFT156; 13 to 29x). For each: read-count check against ENA (all matched), bwa-mem2 to CLFT044, +duplicate removal, random downsampling to 12x of the median depth, `samtools mpileup` (MAPQ and base quality 20, no BAQ) at the 172,706 single-base differences between +JEL423 and CLFT044. Reads with the CLFT044 base and reads with the JEL423 base are counted; the JEL fraction f = n_jel / (n_clft + n_jel) is taken at sites with at least 5 reads. +Classes: clft f <= 0.2, het 0.2 < f < 0.8, jel f >= 0.8. + +## Result (12x for every isolate) +| isolate | class | sites with >= 5 reads | CLFT-only | heterozygous | JEL-only | +|---|---|---|---|---|---| +| CLFT044 | CLFT-type (reference lineage) | 136,328 | 0.890 | 0.105 | 0.005 | +| CLFT165 | CLFT-type | 119,222 | 0.670 | 0.244 | 0.086 | +| CLFT160 | HET-rich | 122,521 | 0.414 | 0.468 | 0.118 | +| CLFT039 | HET-rich | 122,355 | 0.408 | 0.440 | 0.152 | +| CLFT130, CLFT120, CLFT088, CLFT166, CLFT156 | JEL-type | 94,652 to 104,177 | 0.186 to 0.209 | 0.150 to 0.189 | 0.602 to 0.662 | +- The two HET-rich isolates are separated from both control groups at equal depth. Their JEL-only share (0.12 and 0.15) is a fifth of the JEL-type value (0.60 to 0.66), their heterozygous share (0.44 and 0.47) is 2.3 to 3.1 times higher than the JEL-type controls (0.15 to 0.19) and four times that of CLFT044 (0.105). +- CLFT039 (15x; the isolate the ordination could not place): per-scaffold heterozygous share on the 14 scaffolds of 500 kb or more is 0.36 to 0.56 (median 0.46) on every one of them. No control isolate exceeds 0.30 on any scaffold (JEL-type maximum 0.29, CLFT044 0.30). So CLFT039 is heterozygous for both lineages across the whole genome and does not overlap the controls. The depth confound of the ordination is removed here: its position is not a low-depth effect. +- CLFT160: median 0.49, but patchy (0.08 to 0.73 across the 14 scaffolds); low-heterozygosity scaffolds fit the two CLFT-like scaffolds seen with the parent-of-origin windows (`aneuploidy.md`). +- CLFT165: median 0.24 (0.07 to 0.53), mostly CLFT-only with an excess of heterozygous and JEL-only sites compared with CLFT044 (JEL-only 0.086 against 0.005). That is a partial mixture; I did not examine which regions. + +## Limits +- JEL-type isolates show 19 to 21% CLFT-only sites and 60 to 66% JEL-only sites, not 100% JEL: shared alleles between the two lineages, mapping to a CLFT044 reference and the site choice (sites from one alignment) all contribute, so the shares are relative, not mixture proportions. +- Only nine isolates; two HET-rich isolates and one intermediate isolate. No isolate of known hybrid status, no third-lineage reference, no admixture model. A third lineage that shares alleles with both references would give heterozygous sites too; the ordination put the HET-rich isolates off the Swiss/Korean axis (`ancestry_pca.md`), but at 15x for CLFT039. +- Downsampling to 12x gives binomial noise at a site (the heterozygous class is wide, 0.2 to 0.8): a site with true f of 0.5 lands in the het class with high probability, a site with f of 0.1 or 0.9 can drift into it; the contrast between the groups is much larger than that noise. + +## Third-lineage reference: what NCBI offers (searched 2026-11-14) +`esearch` on the assembly database for the genus *Batrachochytrium*, 20 assemblies; 9 of *B. dendrobatidis* (the rest are *B. salamandrivorans*). +| accession | isolate | level | contig N50 | submitter, release | +|---|---|---|---|---| +| GCA_036783925.1 | CLFT044 | scaffold | 1.00 Mb | UC Riverside, 2024-02-22 (the CLFT044 reference used here) | +| GCA_036289345.1, GCA_029704095.1 | CLFT067, CLFT071 | scaffold | 0.83, 0.71 Mb | UC Riverside, 2024-01-30 and 2023-04-12 | +| GCA_048537975.1 | JEL423 | chromosome | 1.49 Mb | University of Exeter, 2025-01-31 (the JEL423 reference used here); an older Broad assembly GCA_000149865.1 also exists | +| GCF_000203795.2 | JAM81 | scaffold | 0.32 Mb | JGI, 2011 | +| GCA_003595275.1 | RTP6 | contig | 1.70 Mb | University of Otago, 2018 | +| GCA_982397245.1 | T46-F (India) | contig | 0.13 Mb | Indian Biological Data Centre, released 2026-04-10 | +- No assembly is labelled with a lineage in the NCBI record, and I did not verify the lineage of JAM81, RTP6 or T46-F. The two Brazilian-lineage assemblies besides CLFT044 (CLFT067, CLFT071) and the JEL423 lineage are the two lineages already used in this report. +- The only candidate for a third lineage is T46-F, from India. It is contig-level with a 0.13 Mb N50, was released five months ago, its lineage is not stated, and its one public read run (ERR14883802, excluded here for a read-count mismatch) is the only data I found for the isolate. I did not run the nine isolates against it: a result would depend on an assumption (that T46-F represents the lineage of KRBOOR_331 and the Swiss isolate) that I cannot check from the record. +- So the third-lineage limit stays: the PCA axis that separates KRBOOR_331 and the Swiss isolate is a signal of a third group, but there is no reference assembly of that group to test CLFT160, CLFT039 and CLFT165 against. diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_af.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_af.tsv new file mode 100644 index 00000000..ba4eaa63 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_af.tsv @@ -0,0 +1,32 @@ +run isolate seq normalised he_flagged share_third_flagged share_half_flagged he_rest share_third_rest share_half_rest he_per_mb_flagged he_per_mb_rest +SRR6375564 CLFT065 CP161936.1 1.589 3593 0.214 0.527 71856 0.389 0.296 4293.3 3057.9 +SRR10698423 CLFT073 CP161937.1 1.512 1796 0.469 0.183 32964 0.398 0.303 2427.4 1397.1 +SRR10698421 CLFT078 CP161938.1 0.52 481 0.345 0.166 44325 0.296 0.405 830.8 1865.8 +SRR10698388 CLFT166 CP161938.1 0.531 404 0.426 0.181 25608 0.391 0.29 697.8 1078.0 +SRR10698387 CLFT167 CP161936.1 1.462 2319 0.461 0.093 35015 0.411 0.301 2771.0 1490.1 +SRR6375514 L2203 CP161926.1 1.46 3107 0.664 0.071 45337 0.225 0.498 1716.7 2012.7 +SRR10698420 CLFT080 CP161930.1 1.459 3274 0.539 0.112 34785 0.36 0.324 2452.8 1512.4 +SRR6375579 KRBOOR_331 CP161926.1 1.45 6128 0.763 0.061 76643 0.218 0.567 3385.9 3402.5 +SRR10698410 CLFT107 CP161935.1 1.438 2502 0.488 0.179 31639 0.4 0.302 2850.9 1348.8 +SRR10698420 CLFT080 CP161931.1 1.431 1862 0.563 0.095 36197 0.366 0.316 1630.9 1560.7 +SRR10698422 CLFT075 CP161924.1 1.429 782 0.409 0.093 36012 0.323 0.375 327.1 1641.0 +SRR10698399 CLFT133 CP161937.1 1.41 1965 0.492 0.158 42936 0.347 0.365 2655.8 1819.7 +SRR10698394 CLFT156 CP161926.1 1.394 2542 0.497 0.135 30671 0.365 0.335 1404.5 1361.6 +SRR10698417 CLFT086 CP161936.1 1.385 2789 0.555 0.163 40831 0.344 0.363 3332.6 1737.6 +SRR7825135 RTP5 CP161931.1 1.383 1841 0.675 0.106 37283 0.235 0.508 1612.5 1607.5 +SRR630414 Generic sample from B. dendrobatis CP161938.1 0.639 892 0.331 0.206 60248 0.521 0.14 1540.7 2536.1 +SRR10698420 CLFT080 CP161937.1 1.358 2208 0.491 0.144 35851 0.369 0.315 2984.2 1519.4 +SRR10698403 CLFT044 CP161931.1 1.356 4053 0.544 0.133 57140 0.375 0.31 3549.9 2463.6 +SRR10698395 CLFT152 CP161926.1 1.355 2673 0.501 0.142 43018 0.36 0.368 1476.9 1909.8 +SRR10698382 CLFT063 CP161936.1 1.346 2553 0.551 0.124 39374 0.353 0.338 3050.6 1675.6 +SRR10698394 CLFT156 CP161929.1 1.333 2630 0.498 0.136 30583 0.364 0.335 1762.0 1338.9 +SRR10698403 CLFT044 CP161933.1 1.331 2975 0.504 0.156 58218 0.381 0.306 2851.6 2499.5 +SRR10698387 CLFT167 CP161937.1 1.323 1021 0.418 0.21 36313 0.414 0.29 1379.9 1539.0 +SRR10698413 CLFT097 CP161926.1 1.323 2941 0.311 0.419 37009 0.346 0.376 1625.0 1643.0 +SRR6375485 JEL261 CP161938.1 0.678 995 0.265 0.408 43879 0.168 0.615 1718.6 1847.1 +SRR6375494 SWED-40.5.13 CP161926.1 1.317 3313 0.5 0.204 48537 0.285 0.447 1830.5 2154.8 +SRR10698412 CLFT100 CP161931.1 1.316 1888 0.443 0.231 32831 0.407 0.3 1653.6 1415.5 +SRR10698389 CLFT165 CP161930.1 0.684 2370 0.396 0.271 62445 0.428 0.244 1775.6 2715.0 +SRR10698389 CLFT165 CP161933.1 0.686 2539 0.41 0.276 62276 0.427 0.244 2433.6 2673.7 +SRR10698394 CLFT156 CP161938.1 0.687 866 0.365 0.262 32347 0.375 0.321 1495.8 1361.6 +SRR6375564 CLFT065 CP161938.1 1.309 2422 0.472 0.116 73027 0.377 0.314 4183.3 3074.0 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_by_sequence.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_by_sequence.tsv new file mode 100644 index 00000000..ec246b53 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_by_sequence.tsv @@ -0,0 +1,17 @@ +seq length class:median_ratio:n_flagged +CP161923.1 4539083 CLFT-type:1.00:1;JEL-type:1.00:0 +CP161924.1 2390478 CLFT-type:1.28:1;JEL-type:1.29:1 +CP161925.1 2054970 CLFT-type:1.25:1;JEL-type:1.21:2 +CP161926.1 1809844 CLFT-type:1.01:2;JEL-type:1.03:7 +CP161927.1 1775023 CLFT-type:1.00:0;JEL-type:1.00:0 +CP161928.1 1588961 CLFT-type:0.96:0;JEL-type:0.94:0 +CP161929.1 1492664 CLFT-type:0.98:2;JEL-type:0.95:1 +CP161930.1 1334775 CLFT-type:0.97:2;JEL-type:0.98:1 +CP161931.1 1141735 CLFT-type:1.01:2;JEL-type:1.00:3 +CP161932.1 1066124 CLFT-type:0.99:0;JEL-type:0.97:0 +CP161933.1 1043290 CLFT-type:0.98:3;JEL-type:0.96:0 +CP161934.1 1064784 CLFT-type:0.95:1;JEL-type:0.92:1 +CP161935.1 877626 CLFT-type:0.95:0;JEL-type:0.92:1 +CP161936.1 836885 CLFT-type:1.00:1;JEL-type:0.99:3 +CP161937.1 739888 CLFT-type:0.85:1;JEL-type:0.94:5 +CP161938.1 578962 CLFT-type:0.74:2;JEL-type:0.76:4 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_flags.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_flags.tsv new file mode 100644 index 00000000..e41f634e --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_flags.tsv @@ -0,0 +1,49 @@ +run isolate class seq length ratio class_median normalised het_per_mb median_depth +SRR10698382 CLFT063 JEL-type CP161934.1 1064784 1.15 0.919 1.252 2050.2 39.0 +SRR10698382 CLFT063 JEL-type CP161936.1 836885 1.335 0.992 1.346 2839.1 39.0 +SRR10698387 CLFT167 JEL-type CP161926.1 1809844 1.325 1.026 1.291 1262.5 25.1 +SRR10698387 CLFT167 JEL-type CP161936.1 836885 1.45 0.992 1.462 2453.1 25.1 +SRR10698387 CLFT167 JEL-type CP161937.1 739888 1.237 0.935 1.323 1258.3 25.1 +SRR10698388 CLFT166 JEL-type CP161926.1 1809844 1.286 1.026 1.253 558.6 28.3 +SRR10698388 CLFT166 JEL-type CP161938.1 578962 0.404 0.761 0.531 640.8 28.3 +SRR10698389 CLFT165 CLFT-type CP161929.1 1492664 1.27 0.981 1.295 4684.2 23.6 +SRR10698389 CLFT165 CLFT-type CP161930.1 1334775 0.663 0.969 0.684 1690.9 23.6 +SRR10698389 CLFT165 CLFT-type CP161933.1 1043290 0.674 0.982 0.686 2341.6 23.6 +SRR10698394 CLFT156 JEL-type CP161926.1 1809844 1.431 1.026 1.394 1298.5 31.3 +SRR10698394 CLFT156 JEL-type CP161929.1 1492664 1.264 0.948 1.333 1623.3 31.3 +SRR10698394 CLFT156 JEL-type CP161938.1 578962 0.523 0.761 0.687 1395.6 31.3 +SRR10698395 CLFT152 JEL-type CP161926.1 1809844 1.391 1.026 1.355 1375.8 28.5 +SRR10698397 CLFT139 CLFT-type CP161925.1 2054970 0.912 1.248 0.731 3261.8 41.1 +SRR10698398 CLFT138 JEL-type CP161925.1 2054970 0.896 1.211 0.74 537.7 29.2 +SRR10698399 CLFT133 JEL-type CP161937.1 739888 1.318 0.935 1.41 2474.7 34.9 +SRR10698401 CLFT131 JEL-type CP161937.1 739888 1.214 0.935 1.298 2959.9 32.9 +SRR10698403 CLFT044 CLFT-type CP161931.1 1141735 1.376 1.015 1.356 3309.0 40.1 +SRR10698403 CLFT044 CLFT-type CP161933.1 1043290 1.307 0.982 1.331 2666.6 40.1 +SRR10698410 CLFT107 JEL-type CP161935.1 877626 1.319 0.917 1.438 2657.2 22.2 +SRR10698412 CLFT100 JEL-type CP161931.1 1141735 1.313 0.998 1.316 1569.5 22.7 +SRR10698413 CLFT097 JEL-type CP161926.1 1809844 1.358 1.026 1.323 1562.6 29.8 +SRR10698417 CLFT086 JEL-type CP161936.1 836885 1.373 0.992 1.385 3162.9 33.3 +SRR10698420 CLFT080 JEL-type CP161930.1 1334775 1.425 0.976 1.459 2269.3 38.4 +SRR10698420 CLFT080 JEL-type CP161931.1 1141735 1.428 0.998 1.431 1504.7 38.4 +SRR10698420 CLFT080 JEL-type CP161937.1 739888 1.27 0.935 1.358 2746.4 38.4 +SRR10698421 CLFT078 JEL-type CP161938.1 578962 0.396 0.761 0.52 713.3 47.9 +SRR10698422 CLFT075 JEL-type CP161924.1 2390478 1.84 1.288 1.429 282.0 32.3 +SRR10698422 CLFT075 JEL-type CP161925.1 2054970 0.862 1.211 0.712 1007.8 32.3 +SRR10698423 CLFT073 JEL-type CP161937.1 739888 1.414 0.935 1.512 2273.3 20.5 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161930.1 1334775 0.7 0.969 0.722 2552.5 86.2 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161933.1 1043290 0.698 0.982 0.711 1674.5 86.2 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161934.1 1064784 0.673 0.949 0.709 940.1 86.2 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161938.1 578962 0.471 0.737 0.639 1331.7 86.2 +SRR6375485 JEL261 JEL-type CP161938.1 578962 0.516 0.761 0.678 1583.9 178.6 +SRR6375494 SWED-40.5.13 JEL-type CP161926.1 1809844 1.352 1.026 1.317 1736.1 42.7 +SRR6375514 L2203 JEL-type CP161926.1 1809844 1.499 1.026 1.46 1630.0 82.1 +SRR6375563 CLFT061 CLFT-type CP161926.1 1809844 1.283 1.015 1.264 2570.4 28.1 +SRR6375564 CLFT065 CLFT-type CP161923.1 4539083 1.278 1.004 1.273 1884.7 54.9 +SRR6375564 CLFT065 CLFT-type CP161924.1 2390478 1.628 1.278 1.274 3008.2 54.9 +SRR6375564 CLFT065 CLFT-type CP161936.1 836885 1.595 1.004 1.589 4041.2 54.9 +SRR6375564 CLFT065 CLFT-type CP161937.1 739888 1.094 0.85 1.287 4139.8 54.9 +SRR6375564 CLFT065 CLFT-type CP161938.1 578962 0.965 0.737 1.309 3789.5 54.9 +SRR6375566 CLFT144 CLFT-type CP161929.1 1492664 1.242 0.981 1.266 2606.7 24.6 +SRR6375566 CLFT144 CLFT-type CP161931.1 1141735 1.301 1.015 1.282 3159.2 24.6 +SRR6375579 KRBOOR_331 CLFT-type CP161926.1 1809844 1.472 1.015 1.45 3264.4 175.0 +SRR7825135 RTP5 JEL-type CP161931.1 1141735 1.38 0.998 1.383 1555.5 71.5 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_flags_with_hetrich.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_flags_with_hetrich.tsv new file mode 100644 index 00000000..c27c695a --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/aneuploidy_flags_with_hetrich.tsv @@ -0,0 +1,51 @@ +run isolate class seq length ratio class_median normalised het_per_mb median_depth +SRR10698382 CLFT063 JEL-type CP161934.1 1064784 1.15 0.919 1.252 2050.2 39.0 +SRR10698382 CLFT063 JEL-type CP161936.1 836885 1.335 0.992 1.346 2839.1 39.0 +SRR10698387 CLFT167 JEL-type CP161926.1 1809844 1.325 1.026 1.291 1262.5 25.1 +SRR10698387 CLFT167 JEL-type CP161936.1 836885 1.45 0.992 1.462 2453.1 25.1 +SRR10698387 CLFT167 JEL-type CP161937.1 739888 1.237 0.935 1.323 1258.3 25.1 +SRR10698388 CLFT166 JEL-type CP161926.1 1809844 1.286 1.026 1.253 558.6 28.3 +SRR10698388 CLFT166 JEL-type CP161938.1 578962 0.404 0.761 0.531 640.8 28.3 +SRR10698389 CLFT165 CLFT-type CP161929.1 1492664 1.27 0.981 1.295 4684.2 23.6 +SRR10698389 CLFT165 CLFT-type CP161930.1 1334775 0.663 0.969 0.684 1690.9 23.6 +SRR10698389 CLFT165 CLFT-type CP161933.1 1043290 0.674 0.982 0.686 2341.6 23.6 +SRR10698391 CLFT160 HET-rich* CP161931.1 1141735 1.316 0.998 1.319 4883.8 27.5 +SRR10698391 CLFT160 HET-rich* CP161936.1 836885 1.367 0.992 1.379 4354.2 27.5 +SRR10698394 CLFT156 JEL-type CP161926.1 1809844 1.431 1.026 1.394 1298.5 31.3 +SRR10698394 CLFT156 JEL-type CP161929.1 1492664 1.264 0.948 1.333 1623.3 31.3 +SRR10698394 CLFT156 JEL-type CP161938.1 578962 0.523 0.761 0.687 1395.6 31.3 +SRR10698395 CLFT152 JEL-type CP161926.1 1809844 1.391 1.026 1.355 1375.8 28.5 +SRR10698397 CLFT139 CLFT-type CP161925.1 2054970 0.912 1.248 0.731 3261.8 41.1 +SRR10698398 CLFT138 JEL-type CP161925.1 2054970 0.896 1.211 0.74 537.7 29.2 +SRR10698399 CLFT133 JEL-type CP161937.1 739888 1.318 0.935 1.41 2474.7 34.9 +SRR10698401 CLFT131 JEL-type CP161937.1 739888 1.214 0.935 1.298 2959.9 32.9 +SRR10698403 CLFT044 CLFT-type CP161931.1 1141735 1.376 1.015 1.356 3309.0 40.1 +SRR10698403 CLFT044 CLFT-type CP161933.1 1043290 1.307 0.982 1.331 2666.6 40.1 +SRR10698410 CLFT107 JEL-type CP161935.1 877626 1.319 0.917 1.438 2657.2 22.2 +SRR10698412 CLFT100 JEL-type CP161931.1 1141735 1.313 0.998 1.316 1569.5 22.7 +SRR10698413 CLFT097 JEL-type CP161926.1 1809844 1.358 1.026 1.323 1562.6 29.8 +SRR10698417 CLFT086 JEL-type CP161936.1 836885 1.373 0.992 1.385 3162.9 33.3 +SRR10698420 CLFT080 JEL-type CP161930.1 1334775 1.425 0.976 1.459 2269.3 38.4 +SRR10698420 CLFT080 JEL-type CP161931.1 1141735 1.428 0.998 1.431 1504.7 38.4 +SRR10698420 CLFT080 JEL-type CP161937.1 739888 1.27 0.935 1.358 2746.4 38.4 +SRR10698421 CLFT078 JEL-type CP161938.1 578962 0.396 0.761 0.52 713.3 47.9 +SRR10698422 CLFT075 JEL-type CP161924.1 2390478 1.84 1.288 1.429 282.0 32.3 +SRR10698422 CLFT075 JEL-type CP161925.1 2054970 0.862 1.211 0.712 1007.8 32.3 +SRR10698423 CLFT073 JEL-type CP161937.1 739888 1.414 0.935 1.512 2273.3 20.5 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161930.1 1334775 0.7 0.969 0.722 2552.5 86.2 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161933.1 1043290 0.698 0.982 0.711 1674.5 86.2 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161934.1 1064784 0.673 0.949 0.709 940.1 86.2 +SRR630414 Generic sample from B. dendrobatis CLFT-type CP161938.1 578962 0.471 0.737 0.639 1331.7 86.2 +SRR6375485 JEL261 JEL-type CP161938.1 578962 0.516 0.761 0.678 1583.9 178.6 +SRR6375494 SWED-40.5.13 JEL-type CP161926.1 1809844 1.352 1.026 1.317 1736.1 42.7 +SRR6375514 L2203 JEL-type CP161926.1 1809844 1.499 1.026 1.46 1630.0 82.1 +SRR6375563 CLFT061 CLFT-type CP161926.1 1809844 1.283 1.015 1.264 2570.4 28.1 +SRR6375564 CLFT065 CLFT-type CP161923.1 4539083 1.278 1.004 1.273 1884.7 54.9 +SRR6375564 CLFT065 CLFT-type CP161924.1 2390478 1.628 1.278 1.274 3008.2 54.9 +SRR6375564 CLFT065 CLFT-type CP161936.1 836885 1.595 1.004 1.589 4041.2 54.9 +SRR6375564 CLFT065 CLFT-type CP161937.1 739888 1.094 0.85 1.287 4139.8 54.9 +SRR6375564 CLFT065 CLFT-type CP161938.1 578962 0.965 0.737 1.309 3789.5 54.9 +SRR6375566 CLFT144 CLFT-type CP161929.1 1492664 1.242 0.981 1.266 2606.7 24.6 +SRR6375566 CLFT144 CLFT-type CP161931.1 1141735 1.301 1.015 1.282 3159.2 24.6 +SRR6375579 KRBOOR_331 CLFT-type CP161926.1 1809844 1.472 1.015 1.45 3264.4 175.0 +SRR7825135 RTP5 JEL-type CP161931.1 1141735 1.38 0.998 1.383 1555.5 71.5 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_isolate_summary_CLFT044.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_isolate_summary_CLFT044.tsv new file mode 100644 index 00000000..5528c9a2 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_isolate_summary_CLFT044.tsv @@ -0,0 +1,70 @@ +run group isolate country mean_depth median_depth snps snps_per_mb het_snps het_fraction hom_alt_fraction het_per_mb het_windows_fraction depth_flag_seqs +SRR10698394 brazil CLFT156 Brazil 29.3 28.8 102633 4015.7 37298 0.3634 0.6201 1459.3 0.591 8 +SRR10698397 brazil CLFT139 Brazil 36.0 40.2 44243 1728.1 38262 0.8648 0.1024 1494.4 0.5461 7 +SRR10698399 brazil CLFT133 Brazil 31.5 33.7 124617 4866.4 51027 0.4095 0.5678 1992.6 0.6529 6 +SRR10698402 brazil CLFT130 Brazil 14.9 13.4 55322 2161.9 21185 0.3829 0.6087 827.9 0.5434 9 +SRR10698405 brazil CLFT126 Brazil 20.1 21.0 111512 4362.9 46872 0.4203 0.5647 1833.9 0.6696 9 +SRR10698410 brazil CLFT107 Brazil 21.7 20.8 101115 3947.6 40285 0.3984 0.5907 1572.8 0.6344 9 +SRR10698414 brazil CLFT043 Brazil 31.5 32.2 112205 4382.8 45611 0.4065 0.5749 1781.6 0.6446 8 +SRR10698421 brazil CLFT078 Brazil 42.2 44.2 119173 4658.0 49047 0.4116 0.5537 1917.0 0.6473 9 +SRR6375563 brazil CLFT061 Brazil 26.1 27.8 45591 1783.7 39358 0.8633 0.1161 1539.9 0.5608 10 +SRR10698382 brazil CLFT063 Brazil 36.0 35.7 116230 4547.8 47604 0.4096 0.5592 1862.6 0.6382 11 +SRR10698383 brazil CLFT062 Brazil 21.8 20.1 104185 4077.5 40623 0.3899 0.6004 1589.9 0.608 7 +SRR10698385 brazil CLFT048 Brazil 20.8 24.1 116853 4590.0 47446 0.406 0.5676 1863.7 0.6386 10 +SRR10698389 brazil CLFT165 Brazil 23.0 23.0 60980 2378.4 46965 0.7702 0.2023 1831.8 0.6367 10 +SRR10698404 brazil CLFT129 Brazil 15.7 14.6 79991 3140.2 28398 0.355 0.6366 1114.8 0.5593 10 +SRR10698406 brazil CLFT123 Brazil 17.9 16.1 90259 3539.8 33338 0.3694 0.6208 1307.5 0.5891 8 +SRR10698407 brazil CLFT120 Brazil 15.3 15.3 78622 3081.1 28614 0.3639 0.6237 1121.3 0.5597 8 +SRR10698422 brazil CLFT075 Brazil 29.5 29.5 112270 4392.9 42534 0.3789 0.5959 1664.3 0.5959 9 +SRR6375565 brazil CLFT067 Brazil 44.9 51.1 54553 2134.1 46025 0.8437 0.1036 1800.5 0.6193 6 +SRR6375567 brazil CLFT071 Brazil 32.2 35.2 52225 2039.8 42610 0.8159 0.1439 1664.3 0.5955 8 +SRR10698388 brazil CLFT166 Brazil 26.2 25.2 92120 3587.5 30848 0.3349 0.6516 1201.3 0.5495 10 +SRR10698392 brazil CLFT045 Brazil 31.0 35.7 125097 4903.4 51425 0.4111 0.5606 2015.7 0.645 7 +SRR10698395 brazil CLFT152 Brazil 27.2 25.8 113299 4446.1 50385 0.4447 0.5402 1977.2 0.7103 11 +SRR10698403 brazil CLFT044 Brazil 38.7 39.1 34741 1356.8 32465 0.9345 0.0301 1267.9 0.463 9 +SRR10698408 brazil CLFT114 Brazil 19.8 20.1 92261 3610.2 31305 0.3393 0.6546 1225.0 0.5442 6 +SRR10698411 brazil CLFT101 Brazil 21.6 23.6 95437 3730.0 38437 0.4027 0.584 1502.2 0.6545 7 +SRR10698417 brazil CLFT086 Brazil 29.2 32.1 121847 4773.9 49312 0.4047 0.5717 1932.0 0.6303 8 +SRR10698418 brazil CLFT085 Brazil 28.2 27.0 111204 4353.6 45673 0.4107 0.5703 1788.1 0.6484 8 +SRR10698384 brazil CLFT060 Brazil 29.3 31.2 117355 4598.6 46198 0.3937 0.5905 1810.3 0.6235 9 +SRR10698391 brazil CLFT160 Brazil 25.5 26.4 100943 3939.5 84032 0.8325 0.1359 3279.5 0.8285 8 +SRR10698393 brazil CLFT157 Brazil 23.0 23.1 100350 3925.1 36957 0.3683 0.6225 1445.5 0.5906 9 +SRR10698396 brazil CLFT148 Brazil 26.3 26.4 42155 1644.6 36549 0.867 0.1112 1425.9 0.54 8 +SRR10698400 brazil CLFT132 Brazil 17.4 16.4 88618 3466.6 35611 0.4018 0.5881 1393.0 0.6261 8 +SRR10698412 brazil CLFT100 Brazil 19.8 21.0 99290 3882.5 39919 0.402 0.5893 1560.9 0.6401 7 +SRR10698420 brazil CLFT080 Brazil 35.2 36.5 122284 4776.9 45824 0.3747 0.5951 1790.1 0.585 11 +SRR10698423 brazil CLFT073 Brazil 19.1 18.9 106827 4190.3 40649 0.3805 0.6056 1594.5 0.591 9 +SRR10698425 brazil CLFT039 Brazil 14.9 15.1 87517 3429.5 70177 0.8019 0.1844 2750.0 0.827 7 +SRR10698381 brazil CLFT068 Brazil 30.8 35.2 50484 1979.2 44524 0.8819 0.0797 1745.5 0.6065 5 +SRR10698387 brazil CLFT167 Brazil 23.8 22.5 97640 3819.5 41227 0.4222 0.5611 1612.7 0.6715 11 +SRR10698390 brazil CLFT163 Brazil 25.0 27.7 117821 4621.9 47268 0.4012 0.5854 1854.2 0.6454 9 +SRR10698398 brazil CLFT138 Brazil 26.0 27.0 108086 4232.8 42449 0.3927 0.5959 1662.4 0.6329 7 +SRR10698401 brazil CLFT131 Brazil 28.2 30.8 117487 4602.3 48052 0.409 0.5698 1882.3 0.6552 8 +SRR10698409 brazil CLFT111 Brazil 26.8 29.8 121125 4744.1 46438 0.3834 0.596 1818.8 0.6122 8 +SRR10698413 brazil CLFT097 Brazil 26.6 28.2 114866 4514.7 44239 0.3851 0.6002 1738.8 0.6171 10 +SRR10698415 brazil CLFT095 Brazil 34.8 38.6 123724 4839.8 49043 0.3964 0.5769 1918.5 0.6216 9 +SRR10698416 brazil CLFT088 Brazil 16.9 15.9 87028 3408.7 35105 0.4034 0.5856 1375.0 0.6099 9 +SRR10698419 brazil CLFT082 Brazil 16.9 15.8 92120 3611.7 33919 0.3682 0.6221 1329.9 0.5706 10 +SRR10698424 brazil CLFT070 Brazil 33.3 37.5 51445 2009.9 45444 0.8834 0.0712 1775.5 0.614 7 +SRR10698426 brazil CLFT037 Brazil 16.9 17.9 108424 4268.1 42169 0.3889 0.6013 1660.0 0.6205 9 +SRR6375524 brazil CLFT001 Brazil 54.7 61.4 47955 1871.5 35399 0.7382 0.2073 1381.5 0.4898 9 +SRR6375564 brazil CLFT065 Brazil 53.9 53.4 51985 2032.7 44926 0.8642 0.0816 1756.7 0.6216 9 +SRR6375566 brazil CLFT144 Brazil 26.6 24.1 42490 1654.2 39647 0.9331 0.036 1543.5 0.6382 10 +SRR6375571 brazil CLFT136 Brazil 34.3 37.4 41944 1639.0 36432 0.8686 0.1085 1423.6 0.5049 5 +SRR6375476 other 06.OZ Australia 75.9 87.4 127172 4970.6 54347 0.4274 0.5476 2124.2 0.676 9 +SRR6375485 other JEL261 Canada 136.1 173.3 113103 4416.3 46007 0.4068 0.5769 1796.4 0.6303 8 +SRR630411 other Generic sample from B. dendrobatis Ethiopia: Telilia Stream near Rira 72.5 90.3 121384 4739.9 51421 0.4236 0.5412 2007.9 0.6703 6 +SRR6375463 other FG32 French Guiana 100.0 123.4 119798 4682.1 45436 0.3793 0.6058 1775.8 0.5971 7 +SRR6375491 other Hung_2014 Hungary 98.3 120.8 124864 4875.4 54177 0.4339 0.5482 2115.4 0.6956 7 +SRR633648 other Generic sample from B. dendrobatis Italy: Sardinia, Affluente Pisharoni 84.8 105.2 119064 4652.5 49285 0.4139 0.5544 1925.9 0.6601 7 +SRR6375514 other L2203 Montserrat 68.8 80.0 123888 4843.0 50729 0.4095 0.5686 1983.1 0.6586 8 +SRR6375457 other BdNL1 Netherlands 34.5 39.4 124329 4891.9 50196 0.4037 0.5812 1975.0 0.6212 6 +SRR7825135 other RTP5 New Zealand: Dunedin 60.8 69.5 116715 4583.1 43463 0.3724 0.6118 1706.7 0.5872 10 +SRR6375517 other JEL423 Panama 119.6 143.4 118045 4611.6 48154 0.4079 0.571 1881.2 0.648 9 +SRR1639274 other JEL427-P17 Puerto Rico: El Yunque National Forest 12.4 10.0 62275 2418.6 30477 0.4894 0.4818 1183.6 0.5835 7 +SRR6375481 other 08MG05 South Africa 124.6 151.4 122775 4806.9 51351 0.4183 0.5683 2010.5 0.6586 8 +SRR6375579 other KRBOOR_331 South Korea 141.1 171.3 130511 5103.9 70964 0.5437 0.4343 2775.2 0.8512 11 +SRR6375494 other SWED-40.5.13 Sweden 35.5 41.7 125510 4923.1 54782 0.4365 0.5478 2148.8 0.6843 8 +SRR630414 other Generic sample from B. dendrobatis Switzerland: Gamlikon 66.9 80.9 105850 4115.0 51403 0.4856 0.4657 1998.3 0.7957 8 +SRR6375448 other TW16-292 Taiwan 36.0 41.9 127355 5003.4 55395 0.435 0.5484 2176.3 0.685 7 +SRR6378438 other UKBER United Kingdom 84.9 97.4 104825 4120.6 45980 0.4386 0.5493 1807.4 0.6843 7 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_isolate_summary_JEL423.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_isolate_summary_JEL423.tsv new file mode 100644 index 00000000..a8cd94f7 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_isolate_summary_JEL423.tsv @@ -0,0 +1,70 @@ +run group isolate country mean_depth median_depth snps snps_per_mb het_snps het_fraction hom_alt_fraction het_per_mb het_windows_fraction depth_flag_seqs +SRR10698394 brazil CLFT156 Brazil 36.2 31.3 41683 1706.3 31547 0.7568 0.1977 1291.4 0.5356 3 +SRR10698397 brazil CLFT139 Brazil 40.0 41.1 136082 5568.2 61920 0.455 0.5162 2533.6 0.7115 1 +SRR10698399 brazil CLFT133 Brazil 39.6 34.9 51795 2119.4 42791 0.8262 0.123 1751.0 0.6052 3 +SRR10698402 brazil CLFT130 Brazil 19.3 14.3 22243 909.8 18014 0.8099 0.1636 736.8 0.5099 3 +SRR10698405 brazil CLFT126 Brazil 24.9 22.7 46097 1888.6 40711 0.8832 0.0787 1667.9 0.6447 2 +SRR10698410 brazil CLFT107 Brazil 28.0 22.2 39239 1604.3 32924 0.8391 0.1298 1346.1 0.5944 3 +SRR10698414 brazil CLFT043 Brazil 39.0 34.8 46644 1905.5 39303 0.8426 0.1078 1605.6 0.5976 1 +SRR10698421 brazil CLFT078 Brazil 51.2 47.9 51930 2124.1 42060 0.8099 0.1135 1720.4 0.6064 2 +SRR6375563 brazil CLFT061 Brazil 28.8 28.1 136178 5570.0 63046 0.463 0.5197 2578.8 0.7304 4 +SRR10698382 brazil CLFT063 Brazil 43.8 39.0 49937 2044.2 39194 0.7849 0.1423 1604.5 0.5976 3 +SRR10698383 brazil CLFT062 Brazil 27.0 21.6 44887 1825.8 35279 0.786 0.1922 1435.0 0.5787 2 +SRR10698385 brazil CLFT048 Brazil 24.4 24.7 50431 2066.1 40547 0.804 0.1368 1661.2 0.6 1 +SRR10698389 brazil CLFT165 Brazil 25.9 23.6 104511 4265.2 61752 0.5909 0.391 2520.1 0.7376 6 +SRR10698404 brazil CLFT129 Brazil 19.6 15.9 32934 1348.7 24827 0.7538 0.2215 1016.7 0.5227 4 +SRR10698406 brazil CLFT123 Brazil 23.7 17.2 34564 1411.5 29799 0.8621 0.1113 1216.9 0.5545 2 +SRR10698407 brazil CLFT120 Brazil 19.2 16.4 31367 1280.8 25091 0.7999 0.1615 1024.6 0.5159 1 +SRR10698422 brazil CLFT075 Brazil 35.4 32.3 47439 1940.4 34637 0.7301 0.2079 1416.7 0.538 2 +SRR6375565 brazil CLFT067 Brazil 49.1 51.8 144872 5923.2 70492 0.4866 0.4711 2882.1 0.7634 0 +SRR6375567 brazil CLFT071 Brazil 35.5 35.6 140753 5759.5 66209 0.4704 0.496 2709.2 0.7372 2 +SRR10698388 brazil CLFT166 Brazil 32.2 28.3 33831 1386.0 24389 0.7209 0.2389 999.2 0.4849 3 +SRR10698392 brazil CLFT045 Brazil 36.6 37.0 52406 2146.2 43311 0.8265 0.1113 1773.7 0.6024 1 +SRR10698395 brazil CLFT152 Brazil 33.5 28.5 52098 2130.9 43972 0.844 0.1193 1798.6 0.7026 3 +SRR10698403 brazil CLFT044 Brazil 42.7 40.1 131999 5399.1 57957 0.4391 0.538 2370.6 0.6825 5 +SRR10698408 brazil CLFT114 Brazil 24.7 21.4 37521 1532.2 27055 0.7211 0.2596 1104.8 0.4897 1 +SRR10698411 brazil CLFT101 Brazil 26.9 24.8 37408 1528.9 32053 0.8568 0.1077 1310.1 0.6177 0 +SRR10698417 brazil CLFT086 Brazil 35.2 33.3 51746 2119.2 41479 0.8016 0.1476 1698.7 0.5907 3 +SRR10698418 brazil CLFT085 Brazil 34.9 29.3 46381 1898.7 38739 0.8352 0.1175 1585.8 0.6137 1 +SRR10698384 brazil CLFT060 Brazil 35.5 33.2 49052 2008.0 38949 0.794 0.1637 1594.4 0.5807 1 +SRR10698391 brazil CLFT160 Brazil 30.2 27.5 112267 4593.9 94453 0.8413 0.1223 3865.0 0.893 3 +SRR10698393 brazil CLFT157 Brazil 28.8 24.7 38057 1554.1 30448 0.8001 0.1709 1243.4 0.5549 2 +SRR10698396 brazil CLFT148 Brazil 29.5 27.0 130896 5349.6 60170 0.4597 0.5235 2459.1 0.7139 1 +SRR10698400 brazil CLFT132 Brazil 22.5 17.6 36975 1508.7 30573 0.8269 0.1455 1247.5 0.5964 3 +SRR10698412 brazil CLFT100 Brazil 24.7 22.7 39200 1603.4 33588 0.8568 0.1159 1373.8 0.6064 1 +SRR10698420 brazil CLFT080 Brazil 43.7 38.4 50473 2066.2 35516 0.7037 0.2306 1453.9 0.5239 5 +SRR10698423 brazil CLFT073 Brazil 23.2 20.5 44183 1807.9 33063 0.7483 0.2128 1352.9 0.5453 3 +SRR10698425 brazil CLFT039 Brazil 17.5 16.2 94645 3874.4 80400 0.8495 0.1335 3291.3 0.8922 0 +SRR10698381 brazil CLFT068 Brazil 33.5 35.7 141549 5789.7 69220 0.489 0.4807 2831.3 0.7674 0 +SRR10698387 brazil CLFT167 Brazil 29.6 25.1 41022 1679.3 35557 0.8668 0.0879 1455.6 0.6362 5 +SRR10698390 brazil CLFT163 Brazil 30.1 29.3 51530 2111.2 40142 0.779 0.191 1644.6 0.6089 2 +SRR10698398 brazil CLFT138 Brazil 31.8 29.2 44434 1816.7 37633 0.8469 0.1211 1538.7 0.5924 1 +SRR10698401 brazil CLFT131 Brazil 34.6 32.9 49469 2025.9 41379 0.8365 0.112 1694.6 0.6105 2 +SRR10698409 brazil CLFT111 Brazil 32.5 30.8 46351 1896.0 36694 0.7917 0.1609 1501.0 0.5521 1 +SRR10698413 brazil CLFT097 Brazil 32.3 29.8 48710 1994.8 38500 0.7904 0.1747 1576.7 0.5702 2 +SRR10698415 brazil CLFT095 Brazil 42.1 40.2 51302 2101.8 39453 0.769 0.1723 1616.4 0.5714 2 +SRR10698416 brazil CLFT088 Brazil 21.7 17.0 35783 1462.4 29742 0.8312 0.1411 1215.5 0.5835 2 +SRR10698419 brazil CLFT082 Brazil 21.0 17.3 39301 1605.5 29252 0.7443 0.2255 1195.0 0.5284 3 +SRR10698424 brazil CLFT070 Brazil 36.7 37.8 143309 5861.9 69984 0.4883 0.4769 2862.6 0.7658 2 +SRR10698426 brazil CLFT037 Brazil 20.2 19.1 43011 1762.1 36457 0.8476 0.1244 1493.6 0.5787 2 +SRR6375524 brazil CLFT001 Brazil 59.6 61.9 140848 5772.7 58616 0.4162 0.5536 2402.4 0.6539 3 +SRR6375564 brazil CLFT065 Brazil 59.3 54.9 144159 5901.3 70642 0.49 0.4703 2891.8 0.7718 3 +SRR6375566 brazil CLFT144 Brazil 29.9 24.6 118961 4854.7 59976 0.5042 0.4766 2447.6 0.7827 3 +SRR6375571 brazil CLFT136 Brazil 38.3 37.8 138370 5650.5 62000 0.4481 0.5287 2531.8 0.699 0 +SRR6375476 other 06.OZ Australia 90.6 89.8 55084 2255.9 48459 0.8797 0.0716 1984.5 0.6374 2 +SRR6375485 other JEL261 Canada 161.2 178.6 57339 2345.3 43249 0.7543 0.2148 1769.0 0.6068 1 +SRR630411 other Generic sample from B. dendrobatis Ethiopia: Telilia Stream near Rira 85.1 93.3 56071 2297.2 46655 0.8321 0.0955 1911.4 0.6435 0 +SRR6375463 other FG32 French Guiana 119.4 127.0 48878 2000.9 39030 0.7985 0.1713 1597.7 0.5457 1 +SRR6375491 other Hung_2014 Hungary 117.3 123.9 61394 2515.3 51741 0.8428 0.1242 2119.8 0.6777 0 +SRR633648 other Generic sample from B. dendrobatis Italy: Sardinia, Affluente Pisharoni 99.6 108.3 50498 2066.3 43092 0.8533 0.0774 1763.3 0.6294 1 +SRR6375514 other L2203 Montserrat 81.9 82.1 54453 2231.8 45834 0.8417 0.1149 1878.6 0.6213 2 +SRR6375457 other BdNL1 Netherlands 40.7 42.1 54894 2249.9 44497 0.8106 0.1566 1823.8 0.5924 1 +SRR7825135 other RTP5 New Zealand: Dunedin 73.4 71.5 44880 1838.7 37533 0.8363 0.1307 1537.7 0.5272 3 +SRR6375517 other JEL423 Panama 142.1 150.4 45241 1851.2 41913 0.9264 0.024 1715.1 0.5847 1 +SRR1639274 other JEL427-P17 Puerto Rico: El Yunque National Forest 14.6 10.8 28545 1164.7 22726 0.7961 0.1194 927.3 0.5799 0 +SRR6375481 other 08MG05 South Africa 150.1 155.2 53590 2194.7 46753 0.8724 0.1004 1914.7 0.6153 0 +SRR6375579 other KRBOOR_331 South Korea 161.0 175.0 158297 6472.1 79177 0.5002 0.4796 3237.2 0.9155 3 +SRR6375494 other SWED-40.5.13 Sweden 42.3 42.7 55414 2272.2 50015 0.9026 0.0639 2050.8 0.6559 2 +SRR630414 other Generic sample from B. dendrobatis Switzerland: Gamlikon 74.9 86.2 125180 5091.5 56253 0.4494 0.5053 2288.0 0.8608 5 +SRR6375448 other TW16-292 Taiwan 42.8 43.3 55696 2282.8 50259 0.9024 0.0613 2059.9 0.6483 0 +SRR6378438 other UKBER United Kingdom 100.6 105.0 51188 2095.6 43623 0.8522 0.1244 1785.9 0.6869 1 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_runs_popseq.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_runs_popseq.tsv new file mode 100644 index 00000000..60e51d0f --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/bd_runs_popseq.tsv @@ -0,0 +1,73 @@ +group run study isolate country country_iso host_name collection_date base_count read_count est_depth_x exclusion +brazil SRR10698394 PRJNA595972 CLFT156 Brazil BR Hylodes cardosoi 2015 1731749544 6872022 72.7 none +brazil SRR10698397 PRJNA595972 CLFT139 Brazil BR Hylodes cardosoi 2014 1951158384 7742692 81.9 none +brazil SRR10698399 PRJNA595972 CLFT133 Brazil BR Phyllomedusa 2014 1991709216 7903608 83.7 none +brazil SRR10698402 PRJNA595972 CLFT130 Brazil BR Scinax fuscovarius 2014 1045608228 4149239 43.9 none +brazil SRR10698405 PRJNA595972 CLFT126 Brazil BR Phyllomedusa 2014 1339713648 5316324 56.3 none +brazil SRR10698410 PRJNA595972 CLFT107 Brazil BR Bokermannohyla sp. 2014 1480133340 5873545 62.2 none +brazil SRR10698414 PRJNA595972 CLFT043 Brazil BR Hylodes cardosoi 2013 1903174308 7552279 79.9 none +brazil SRR10698421 PRJNA595972 CLFT078 Brazil BR Bokermannohyla sp. 2013 2499405300 9918275 105.0 none +brazil SRR6375563 PRJNA413876 CLFT061 Brazil BR 2013 1258830720 4995360 52.9 none +brazil SRR10698382 PRJNA595972 CLFT063 Brazil BR Hylodes meridionalis 2013 2433540312 9656906 102.2 none +brazil SRR10698383 PRJNA595972 CLFT062 Brazil BR Hylodes meridionalis 2013 1221974460 4849105 51.3 none +brazil SRR10698385 PRJNA595972 CLFT048 Brazil BR Hylodes meridionalis 2013 1573554276 6244263 66.1 none +brazil SRR10698389 PRJNA595972 CLFT165 Brazil BR Hylodes cardosoi 2015 1239987420 4920585 52.1 none +brazil SRR10698404 PRJNA595972 CLFT129 Brazil BR Aplastodiscus 2014 1038222612 4119931 43.6 none +brazil SRR10698406 PRJNA595972 CLFT123 Brazil BR Bokermannohyla sp. 2014 1631531916 6474333 68.5 none +brazil SRR10698407 PRJNA595972 CLFT120 Brazil BR Bokermannohyla sp. 2014 1131258744 4489122 47.5 none +brazil SRR10698422 PRJNA595972 CLFT075 Brazil BR unidentified 2013 1816474968 7208234 76.3 none +brazil SRR6375565 PRJNA413876 CLFT067 Brazil BR 2013 2730762720 10836360 114.7 none +brazil SRR6375567 PRJNA413876 CLFT071 Brazil BR 2013 1995138684 7917217 83.8 none +brazil SRR10698388 PRJNA595972 CLFT166 Brazil BR unidentified 2015 1459787868 5792809 61.3 none +brazil SRR10698392 PRJNA595972 CLFT045 Brazil BR Hylodes cardosoi 2013 1897724808 7530654 79.7 none +brazil SRR10698395 PRJNA595972 CLFT152 Brazil BR Crossodactylus schmidti 2014 1598202396 6342073 67.1 none +brazil SRR10698403 PRJNA595972 CLFT044 Brazil BR Hylodes cardosoi 2013 1715538384 6807692 72.1 none +brazil SRR10698408 PRJNA595972 CLFT114 Brazil BR Bokermannohyla sp. 2014 1068307884 4239317 44.9 none +brazil SRR10698411 PRJNA595972 CLFT101 Brazil BR Aplastodiscus 2014 1262470356 5009803 53.0 none +brazil SRR10698417 PRJNA595972 CLFT086 Brazil BR unidentified 2013 1523635092 6046171 64.0 none +brazil SRR10698418 PRJNA595972 CLFT085 Brazil BR unidentified 2013 1738940112 6900556 73.0 none +brazil SRR10698384 PRJNA595972 CLFT060 Brazil BR Hylodes meridionalis 2013 1374415308 5454029 57.7 none +brazil SRR10698391 PRJNA595972 CLFT160 Brazil BR Hylodes cardosoi 2015 1602181224 6357862 67.3 none +brazil SRR10698393 PRJNA595972 CLFT157 Brazil BR Hylodes cardosoi 2015 1312652628 5208939 55.1 none +brazil SRR10698396 PRJNA595972 CLFT148 Brazil BR Hylodes cardosoi 2014 1431113040 5679020 60.1 none +brazil SRR10698400 PRJNA595972 CLFT132 Brazil BR Dendropsophus minutus 2014 1292240376 5127938 54.3 none +brazil SRR10698412 PRJNA595972 CLFT100 Brazil BR Bokermannohyla sp. 2014 1108672488 4399494 46.6 none +brazil SRR10698420 PRJNA595972 CLFT080 Brazil BR Bokermannohyla sp. 2013 2258897760 8963880 94.9 none +brazil SRR10698423 PRJNA595972 CLFT073 Brazil BR Aplastodiscus 2013 1245914208 4944104 52.3 none +brazil SRR10698425 PRJNA595972 CLFT039 Brazil BR Bokermannohyla hylax 2013 842239944 3342222 35.4 none +brazil SRR10698381 PRJNA595972 CLFT068 Brazil BR Hylodes japi 2013 1764237888 7000944 74.1 none +brazil SRR10698387 PRJNA595972 CLFT167 Brazil BR unidentified 2015 1517541480 6021990 63.7 none +brazil SRR10698390 PRJNA595972 CLFT163 Brazil BR Hylodes cardosoi 2015 1121897952 4451976 47.1 none +brazil SRR10698398 PRJNA595972 CLFT138 Brazil BR Hylodes cardosoi 2014 1338782256 5312628 56.2 none +brazil SRR10698401 PRJNA595972 CLFT131 Brazil BR Aquarana catesbeiana 2014 1515031056 6012028 63.6 none +brazil SRR10698409 PRJNA595972 CLFT111 Brazil BR Aplastodiscus 2014 1478492820 5867035 62.1 none +brazil SRR10698413 PRJNA595972 CLFT097 Brazil BR Aplastodiscus 2014 1394937684 5535467 58.6 none +brazil SRR10698415 PRJNA595972 CLFT095 Brazil BR Aplastodiscus 2014 1844497872 7319436 77.5 none +brazil SRR10698416 PRJNA595972 CLFT088 Brazil BR Scinax hayii 2013 1083791520 4300760 45.5 none +brazil SRR10698419 PRJNA595972 CLFT082 Brazil BR Bokermannohyla sp. 2013 1150469208 4565354 48.3 none +brazil SRR10698424 PRJNA595972 CLFT070 Brazil BR Hylodes japi 2013 2064857004 8193877 86.7 none +brazil SRR10698426 PRJNA595972 CLFT037 Brazil BR Boana faber 2013 829753596 3292673 34.8 none +brazil SRR6375524 PRJNA413876 CLFT001 Brazil BR 2010 1918125500 7672502 80.6 none +brazil SRR6375564 PRJNA413876 CLFT065 Brazil BR 2013 3165878772 12563011 133.0 none +brazil SRR6375566 PRJNA413876 CLFT144 Brazil BR 2014 1703699676 6760713 71.6 none +brazil SRR6375571 PRJNA413876 CLFT136 Brazil BR 2014 1800737316 7145783 75.6 none +other SRR6375476 PRJNA413876 06.OZ Australia AU 2010 2909957000 11639828 122.2 none +other SRR6375442 PRJNA413876 BdBE1 Belgium BE 2015 2626825250 10507301 110.3 none +other SRR6375485 PRJNA413876 JEL261 Canada CA 1999 5410513400 27052567 227.2 none +other SRR13660529 PRJNA413876 BdGPL Chile: Santiago CL Calyptocephallela gayi 2017-01-02 5134890800 29477484 215.7 none +other SRR630411 PRJNA174849 Generic sample from B. dendrobatis Ethiopia: Telilia Stream near Rira ET 2011 3780401724 19092938 158.8 none +other SRR6375463 PRJNA413876 FG32 French Guiana GF 2015 3666566000 14666264 154.0 none +other SRR6375491 PRJNA413876 Hung_2014 Hungary HU 2014 3690386000 14761544 155.0 none +other ERR14883802 PRJEB88900 T46F India IN 2022-04-08 1571343438 8437644 66.0 none +other SRR633648 PRJNA174849 Generic sample from B. dendrobatis Italy: Sardinia, Affluente Pisharoni IT 2010 4096963926 20691737 172.1 none +other SRR6375514 PRJNA413876 L2203 Montserrat MS 2009 2593275250 10373101 108.9 none +other SRR6375457 PRJNA413876 BdNL1 Netherlands NL 2015 1222026000 4888104 51.3 none +other SRR7825135 PRJNA483086 RTP5 New Zealand: Dunedin NZ Rawlinsonia ewingii 2009 2204895400 11024477 92.6 none +other SRR6375517 PRJNA413876 JEL423 Panama PA 2004 4845347400 24226737 203.5 none +other SRR1639274 PRJNA265883 JEL427-P17 Puerto Rico: El Yunque National Forest PR Eleutherodactylus coqui 2005 1127174216 2176012 47.3 none +other SRR6375481 PRJNA413876 08MG05 South Africa ZA 2008 4676198750 18704795 196.4 none +other SRR6375579 PRJNA413876 KRBOOR_331 South Korea KR 2014 5651899400 28259497 237.4 none +other SRR6375494 PRJNA413876 SWED-40.5.13 Sweden SE 2016 1289954500 5159818 54.2 none +other SRR630414 PRJNA174849 Generic sample from B. dendrobatis Switzerland: Gamlikon CH 2007 3806903826 19226787 159.9 none +other SRR6375448 PRJNA413876 TW16-292 Taiwan TW 2016 1291745500 5166982 54.3 none +other SRR6378438 PRJNA413876 UKBER United Kingdom GB 2012 2982382400 14911912 125.3 none diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/excluded_runs.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/excluded_runs.tsv new file mode 100644 index 00000000..abf5b961 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/excluded_runs.tsv @@ -0,0 +1,3 @@ +SRR6375442 BdBE1 downloaded only as SRA Lite (simplified base qualities); excluded from variant analysis +SRR13660529 mate2 7132682 vs ena 29477484 +ERR14883802 mates 4218822 each; ena 8437644 (= 2x mate count) diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/genomewide_allele_balance.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/genomewide_allele_balance.tsv new file mode 100644 index 00000000..a2289d77 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/genomewide_allele_balance.tsv @@ -0,0 +1,70 @@ +run isolate class median_depth he_sites share_third share_half baseline +SRR10698394 CLFT156 JEL-type 31.3 33213 0.375 0.319 mixed +SRR10698397 CLFT139 CLFT-type 41.1 65522 0.328 0.363 mixed +SRR10698399 CLFT133 JEL-type 34.9 44901 0.354 0.356 mixed +SRR10698402 CLFT130 JEL-type 14.3 18766 0.478 0.244 third-dominated +SRR10698405 CLFT126 JEL-type 22.7 42144 0.389 0.327 mixed +SRR10698410 CLFT107 JEL-type 22.2 34141 0.406 0.293 third-dominated +SRR10698414 CLFT043 JEL-type 34.8 41178 0.317 0.399 mixed +SRR10698421 CLFT078 JEL-type 47.9 44806 0.296 0.402 half-dominated +SRR6375563 CLFT061 CLFT-type 28.1 65686 0.398 0.314 mixed +SRR10698382 CLFT063 JEL-type 39.0 41927 0.365 0.325 mixed +SRR10698383 CLFT062 JEL-type 21.6 36444 0.412 0.308 third-dominated +SRR10698385 CLFT048 JEL-type 24.7 42733 0.355 0.352 mixed +SRR10698389 CLFT165 CLFT-type 23.6 64815 0.427 0.245 third-dominated +SRR10698404 CLFT129 JEL-type 15.9 25719 0.447 0.276 third-dominated +SRR10698406 CLFT123 JEL-type 17.2 30833 0.421 0.309 third-dominated +SRR10698407 CLFT120 JEL-type 16.4 26295 0.449 0.254 third-dominated +SRR10698422 CLFT075 JEL-type 32.3 36794 0.325 0.369 mixed +SRR6375565 CLFT067 CLFT-type 51.8 75493 0.3 0.387 mixed +SRR6375567 CLFT071 CLFT-type 35.6 70319 0.358 0.335 mixed +SRR10698388 CLFT166 JEL-type 28.3 26012 0.391 0.288 third-dominated +SRR10698392 CLFT045 JEL-type 37.0 45794 0.32 0.389 mixed +SRR10698395 CLFT152 JEL-type 28.5 45691 0.368 0.355 mixed +SRR10698403 CLFT044 CLFT-type 40.1 61193 0.387 0.299 mixed +SRR10698408 CLFT114 JEL-type 21.4 27981 0.418 0.303 third-dominated +SRR10698411 CLFT101 JEL-type 24.8 33459 0.399 0.309 mixed +SRR10698417 CLFT086 JEL-type 33.3 43620 0.358 0.35 mixed +SRR10698418 CLFT085 JEL-type 29.3 40622 0.369 0.34 mixed +SRR10698384 CLFT060 JEL-type 33.2 40821 0.339 0.372 mixed +SRR10698391 CLFT160 HET-rich 27.5 97889 0.386 0.344 mixed +SRR10698393 CLFT157 JEL-type 24.7 31625 0.414 0.299 third-dominated +SRR10698396 CLFT148 CLFT-type 27.0 62905 0.382 0.326 mixed +SRR10698400 CLFT132 JEL-type 17.6 31721 0.436 0.288 third-dominated +SRR10698412 CLFT100 JEL-type 22.7 34719 0.409 0.296 third-dominated +SRR10698420 CLFT080 JEL-type 38.4 38059 0.376 0.306 mixed +SRR10698423 CLFT073 JEL-type 20.5 34760 0.402 0.296 third-dominated +SRR10698425 CLFT039 HET-rich 16.2 82249 0.425 0.33 mixed +SRR10698381 CLFT068 CLFT-type 35.7 73040 0.33 0.374 mixed +SRR10698387 CLFT167 JEL-type 25.1 37334 0.414 0.288 third-dominated +SRR10698390 CLFT163 JEL-type 29.3 41578 0.364 0.367 mixed +SRR10698398 CLFT138 JEL-type 29.2 38844 0.345 0.391 mixed +SRR10698401 CLFT131 JEL-type 32.9 43561 0.371 0.333 mixed +SRR10698409 CLFT111 JEL-type 30.8 38571 0.344 0.365 mixed +SRR10698413 CLFT097 JEL-type 29.8 39950 0.344 0.379 mixed +SRR10698415 CLFT095 JEL-type 40.2 41759 0.318 0.392 mixed +SRR10698416 CLFT088 JEL-type 17.0 31167 0.445 0.275 third-dominated +SRR10698419 CLFT082 JEL-type 17.3 30538 0.43 0.279 third-dominated +SRR10698424 CLFT070 CLFT-type 37.8 74266 0.323 0.372 mixed +SRR10698426 CLFT037 JEL-type 19.1 37694 0.422 0.307 third-dominated +SRR6375524 CLFT001 CLFT-type 61.9 63763 0.375 0.264 third-dominated +SRR6375564 CLFT065 CLFT-type 54.9 75449 0.38 0.307 mixed +SRR6375566 CLFT144 CLFT-type 24.6 62654 0.415 0.293 third-dominated +SRR6375571 CLFT136 CLFT-type 37.8 65186 0.34 0.355 mixed +SRR6375476 06.OZ JEL-type 89.8 50923 0.244 0.502 half-dominated +SRR6375485 JEL261 JEL-type 178.6 44874 0.17 0.611 half-dominated +SRR630411 Generic sample from B. dendrobatis JEL-type 93.3 49615 0.201 0.529 half-dominated +SRR6375463 FG32 JEL-type 127.0 40615 0.193 0.569 half-dominated +SRR6375491 Hung_2014 JEL-type 123.9 53736 0.194 0.57 half-dominated +SRR633648 Generic sample from B. dendrobatis JEL-type 108.3 45700 0.19 0.551 half-dominated +SRR6375514 L2203 JEL-type 82.1 48444 0.253 0.471 half-dominated +SRR6375457 BdNL1 JEL-type 42.1 46326 0.312 0.407 mixed +SRR7825135 RTP5 JEL-type 71.5 39124 0.255 0.489 half-dominated +SRR6375517 JEL423 JEL-type 150.4 43895 0.309 0.46 half-dominated +SRR1639274 JEL427-P17 JEL-type 10.8 25126 0.437 0.17 third-dominated +SRR6375481 08MG05 JEL-type 155.2 48281 0.176 0.607 half-dominated +SRR6375579 KRBOOR_331 CLFT-type 175.0 82771 0.259 0.529 half-dominated +SRR6375494 SWED-40.5.13 JEL-type 42.7 51850 0.299 0.431 half-dominated +SRR630414 Generic sample from B. dendrobatis CLFT-type 86.2 61140 0.518 0.141 third-dominated +SRR6375448 TW16-292 JEL-type 43.3 52287 0.288 0.441 half-dominated +SRR6378438 UKBER JEL-type 105.0 44790 0.201 0.57 half-dominated diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/hetrich_by_sequence.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/hetrich_by_sequence.tsv new file mode 100644 index 00000000..667c6f59 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/hetrich_by_sequence.tsv @@ -0,0 +1,61 @@ +run reference seq length depth_ratio he_per_mb share_third share_half windows share_CLFT share_HET share_JELHOM +SRR10698391 JEL423 CP161923.1 4539083 1.012 4102.8 0.355 0.433 +SRR10698391 JEL423 CP161924.1 2390478 1.134 3923.9 0.363 0.378 +SRR10698391 JEL423 CP161925.1 2054970 1.387 3724.1 0.503 0.167 +SRR10698391 JEL423 CP161926.1 1809844 0.978 4115.3 0.372 0.379 +SRR10698391 JEL423 CP161927.1 1775023 0.986 2950.9 0.360 0.376 +SRR10698391 JEL423 CP161928.1 1588961 0.939 4022.1 0.363 0.370 +SRR10698391 JEL423 CP161929.1 1492664 0.938 5070.1 0.351 0.363 +SRR10698391 JEL423 CP161930.1 1334775 0.962 4821.8 0.361 0.380 +SRR10698391 JEL423 CP161931.1 1141735 1.316 5172.0 0.471 0.207 +SRR10698391 JEL423 CP161932.1 1066124 0.943 4197.4 0.367 0.385 +SRR10698391 JEL423 CP161933.1 1043290 0.964 2062.7 0.383 0.273 +SRR10698391 JEL423 CP161934.1 1064784 0.897 4378.4 0.374 0.373 +SRR10698391 JEL423 CP161935.1 877626 0.92 1736.5 0.379 0.193 +SRR10698391 JEL423 CP161936.1 836885 1.367 4642.2 0.485 0.194 +SRR10698391 JEL423 CP161937.1 739888 0.875 5142.7 0.386 0.312 +SRR10698391 JEL423 CP161938.1 578962 0.831 4739.5 0.365 0.331 +SRR10698391 CLFT044 JAQIHF010000001.1 4271105 1.047 86 0.140 0.860 0.000 +SRR10698391 CLFT044 JAQIHF010000002.1 2429103 1.102 44 0.227 0.750 0.023 +SRR10698391 CLFT044 JAQIHF010000003.1 1821279 1.014 36 0.472 0.417 0.111 +SRR10698391 CLFT044 JAQIHF010000004.1 1449457 1.024 29 0.138 0.828 0.034 +SRR10698391 CLFT044 JAQIHF010000005.1 1292353 1.122 26 0.385 0.538 0.077 +SRR10698391 CLFT044 JAQIHF010000006.1 1130921 1.392 22 0.364 0.636 0.000 +SRR10698391 CLFT044 JAQIHF010000007.1 1102615 0.993 22 0.273 0.727 0.000 +SRR10698391 CLFT044 JAQIHF010000008.1 1010461 1.03 19 0.105 0.895 0.000 +SRR10698391 CLFT044 JAQIHF010000009.1 1001226 1.198 19 0.158 0.842 0.000 +SRR10698391 CLFT044 JAQIHF010000010.1 975555 0.987 19 0.316 0.105 0.579 +SRR10698391 CLFT044 JAQIHF010000011.1 956964 0.963 18 0.333 0.667 0.000 +SRR10698391 CLFT044 JAQIHF010000012.1 927035 0.945 19 0.421 0.579 0.000 +SRR10698391 CLFT044 JAQIHF010000013.1 794278 1.347 14 0.143 0.786 0.071 +SRR10698391 CLFT044 JAQIHF010000014.1 691023 0.934 14 0.500 0.000 0.500 +SRR10698425 JEL423 CP161923.1 4539083 1.049 3415.7 0.416 0.369 +SRR10698425 JEL423 CP161924.1 2390478 1.14 3275.5 0.445 0.302 +SRR10698425 JEL423 CP161925.1 2054970 1.243 1578.6 0.451 0.219 +SRR10698425 JEL423 CP161926.1 1809844 1.0 3071.5 0.415 0.349 +SRR10698425 JEL423 CP161927.1 1775023 1.023 3802.8 0.426 0.345 +SRR10698425 JEL423 CP161928.1 1588961 0.908 3380.8 0.418 0.333 +SRR10698425 JEL423 CP161929.1 1492664 0.905 3781.8 0.416 0.345 +SRR10698425 JEL423 CP161930.1 1334775 0.944 3947.5 0.422 0.330 +SRR10698425 JEL423 CP161931.1 1141735 1.009 4225.1 0.429 0.330 +SRR10698425 JEL423 CP161932.1 1066124 0.952 3687.2 0.412 0.345 +SRR10698425 JEL423 CP161933.1 1043290 0.999 3558.0 0.417 0.316 +SRR10698425 JEL423 CP161934.1 1064784 0.829 3396.0 0.418 0.341 +SRR10698425 JEL423 CP161935.1 877626 0.828 3596.1 0.454 0.285 +SRR10698425 JEL423 CP161936.1 836885 0.966 3591.9 0.427 0.333 +SRR10698425 JEL423 CP161937.1 739888 0.843 3684.3 0.439 0.278 +SRR10698425 JEL423 CP161938.1 578962 0.766 3635.8 0.441 0.291 +SRR10698425 CLFT044 JAQIHF010000001.1 4271105 1.109 85 0.176 0.776 0.047 +SRR10698425 CLFT044 JAQIHF010000002.1 2429103 1.161 43 0.140 0.535 0.326 +SRR10698425 CLFT044 JAQIHF010000003.1 1821279 1.059 34 0.265 0.735 0.000 +SRR10698425 CLFT044 JAQIHF010000004.1 1449457 1.1 29 0.241 0.690 0.069 +SRR10698425 CLFT044 JAQIHF010000005.1 1292353 1.15 24 0.292 0.667 0.042 +SRR10698425 CLFT044 JAQIHF010000006.1 1130921 1.061 21 0.238 0.714 0.048 +SRR10698425 CLFT044 JAQIHF010000007.1 1102615 0.997 22 0.182 0.818 0.000 +SRR10698425 CLFT044 JAQIHF010000008.1 1010461 1.069 19 0.105 0.895 0.000 +SRR10698425 CLFT044 JAQIHF010000009.1 1001226 1.203 19 0.105 0.842 0.053 +SRR10698425 CLFT044 JAQIHF010000010.1 975555 1.057 19 0.158 0.474 0.368 +SRR10698425 CLFT044 JAQIHF010000011.1 956964 0.926 18 0.222 0.778 0.000 +SRR10698425 CLFT044 JAQIHF010000012.1 927035 0.905 18 0.333 0.667 0.000 +SRR10698425 CLFT044 JAQIHF010000013.1 794278 0.907 12 0.083 0.833 0.083 +SRR10698425 CLFT044 JAQIHF010000014.1 691023 0.89 13 0.308 0.615 0.077 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_null_CLFT044.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_null_CLFT044.tsv new file mode 100644 index 00000000..35a39db7 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_null_CLFT044.tsv @@ -0,0 +1,101 @@ +perm regions +0 115 +1 116 +2 115 +3 120 +4 125 +5 115 +6 119 +7 125 +8 125 +9 118 +10 105 +11 127 +12 122 +13 109 +14 119 +15 125 +16 114 +17 110 +18 116 +19 121 +20 115 +21 125 +22 119 +23 121 +24 117 +25 122 +26 124 +27 120 +28 131 +29 130 +30 122 +31 114 +32 119 +33 121 +34 121 +35 120 +36 130 +37 115 +38 119 +39 108 +40 127 +41 130 +42 116 +43 120 +44 107 +45 120 +46 121 +47 119 +48 124 +49 127 +50 122 +51 125 +52 114 +53 115 +54 117 +55 121 +56 114 +57 121 +58 117 +59 134 +60 115 +61 117 +62 128 +63 116 +64 127 +65 128 +66 131 +67 106 +68 119 +69 110 +70 108 +71 124 +72 124 +73 123 +74 119 +75 113 +76 121 +77 120 +78 110 +79 106 +80 123 +81 117 +82 118 +83 123 +84 115 +85 136 +86 122 +87 119 +88 125 +89 127 +90 113 +91 119 +92 125 +93 114 +94 111 +95 121 +96 122 +97 124 +98 118 +99 126 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_null_JEL423.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_null_JEL423.tsv new file mode 100644 index 00000000..8a5447bf --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_null_JEL423.tsv @@ -0,0 +1,101 @@ +perm regions +0 113 +1 114 +2 97 +3 108 +4 105 +5 103 +6 117 +7 110 +8 116 +9 109 +10 109 +11 124 +12 110 +13 101 +14 100 +15 100 +16 108 +17 112 +18 121 +19 95 +20 104 +21 112 +22 112 +23 109 +24 118 +25 115 +26 105 +27 123 +28 109 +29 118 +30 114 +31 112 +32 124 +33 101 +34 115 +35 103 +36 107 +37 115 +38 112 +39 114 +40 110 +41 110 +42 122 +43 125 +44 107 +45 117 +46 103 +47 112 +48 111 +49 111 +50 108 +51 106 +52 104 +53 115 +54 116 +55 112 +56 105 +57 120 +58 116 +59 114 +60 104 +61 105 +62 120 +63 114 +64 113 +65 111 +66 107 +67 104 +68 117 +69 118 +70 112 +71 102 +72 104 +73 113 +74 114 +75 92 +76 117 +77 111 +78 100 +79 105 +80 103 +81 114 +82 113 +83 103 +84 114 +85 106 +86 112 +87 107 +88 114 +89 106 +90 119 +91 116 +92 116 +93 102 +94 106 +95 117 +96 105 +97 103 +98 107 +99 114 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_regions_CLFT044.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_regions_CLFT044.tsv new file mode 100644 index 00000000..8608a5cf --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_regions_CLFT044.tsv @@ -0,0 +1,72 @@ +seq start end length windows aligned_to_other_ref n_isolates n_full n_half n_low n_other full_by_group half_by_group low_by_group het_median_half het_median_full n_genes keyword_genes +JAQIHF010000001.1 1230000 1250000 20000 2 1.0 58 18 23 0 17 JEL-type:18 CLFT-type:11;HET-rich:1;JEL-type:11 27.0 54.2 7 +JAQIHF010000001.1 2720000 2750000 30000 3 1.0 58 43 3 0 12 CLFT-type:13;HET-rich:1;JEL-type:29 JEL-type:3 18 24 14 +JAQIHF010000001.1 3060000 3080000 20000 2 1.0 58 22 8 0 28 CLFT-type:4;JEL-type:18 CLFT-type:1;JEL-type:7 6.2 8.0 8 +JAQIHF010000002.1 640000 680000 40000 4 1.0 58 37 6 0 15 CLFT-type:12;JEL-type:25 CLFT-type:1;JEL-type:5 26.0 34.0 16 +JAQIHF010000003.1 40000 70000 30000 3 0.697 58 11 13 5 29 CLFT-type:8;HET-rich:1;JEL-type:2 JEL-type:13 CLFT-type:2;JEL-type:3 49 6 14 +JAQIHF010000003.1 120000 150000 30000 3 0.671 58 13 11 22 12 CLFT-type:12;HET-rich:1 CLFT-type:1;JEL-type:10 CLFT-type:1;JEL-type:21 50 2 7 +JAQIHF010000003.1 400000 440000 40000 4 0.923 58 14 36 0 8 CLFT-type:13;HET-rich:1 CLFT-type:2;JEL-type:34 41.8 0.5 17 +JAQIHF010000003.1 810000 830000 20000 2 0.953 58 40 3 0 15 CLFT-type:12;HET-rich:1;JEL-type:27 JEL-type:3 59.0 63.8 10 +JAQIHF010000003.1 1650000 1680000 30000 3 0.996 58 13 44 0 1 CLFT-type:13 CLFT-type:2;JEL-type:42 38.0 2 16 +JAQIHF010000003.1 1740000 1760000 20000 2 0.619 58 18 17 0 23 CLFT-type:8;JEL-type:10 HET-rich:1;JEL-type:16 21.5 24.5 8 +JAQIHF010000003.1 1770000 1790000 20000 2 0.974 58 8 1 28 21 CLFT-type:8 CLFT-type:1 JEL-type:28 52.5 5.2 4 +JAQIHF010000004.1 20000 40000 20000 2 0.665 58 5 6 29 18 CLFT-type:5 CLFT-type:3;HET-rich:1;JEL-type:2 CLFT-type:5;JEL-type:24 26.2 2.0 3 +JAQIHF010000004.1 930000 950000 20000 2 0.977 58 9 26 0 23 CLFT-type:3;JEL-type:6 CLFT-type:5;JEL-type:21 64.8 53.5 9 +JAQIHF010000004.1 1310000 1340000 30000 3 0.993 58 4 38 0 16 CLFT-type:4 CLFT-type:7;JEL-type:31 33.0 5.5 12 +JAQIHF010000005.1 1150000 1180000 30000 3 1.0 58 9 13 2 34 CLFT-type:4;HET-rich:1;JEL-type:4 CLFT-type:2;JEL-type:11 CLFT-type:1;JEL-type:1 29 15 11 +JAQIHF010000005.1 1280000 1300000 20000 2 0.0 58 5 24 5 24 CLFT-type:2;JEL-type:3 CLFT-type:4;JEL-type:20 CLFT-type:2;JEL-type:3 10.0 7.0 2 +JAQIHF010000006.1 20000 60000 40000 4 0.517 58 14 29 3 12 CLFT-type:12;HET-rich:1;JEL-type:1 CLFT-type:1;JEL-type:28 CLFT-type:1;JEL-type:2 27.0 4.0 9 +JAQIHF010000006.1 70000 100000 30000 3 0.767 58 12 37 0 9 CLFT-type:11;HET-rich:1 CLFT-type:3;JEL-type:34 42 6.0 11 +JAQIHF010000006.1 830000 850000 20000 2 0.943 58 15 33 0 10 CLFT-type:9;HET-rich:1;JEL-type:5 CLFT-type:2;JEL-type:31 61.0 22.5 10 +JAQIHF010000006.1 930000 970000 40000 4 0.944 58 12 34 0 12 CLFT-type:11;HET-rich:1 CLFT-type:2;JEL-type:32 43.5 0.5 16 +JAQIHF010000006.1 1030000 1050000 20000 2 1.0 58 10 33 0 15 CLFT-type:5;HET-rich:1;JEL-type:4 CLFT-type:2;JEL-type:31 15.5 8.0 8 +JAQIHF010000006.1 1060000 1110000 50000 5 1.0 58 8 5 33 12 CLFT-type:8 HET-rich:1;JEL-type:4 CLFT-type:1;JEL-type:32 28 1.0 12 +JAQIHF010000007.1 190000 210000 20000 2 1.0 58 12 13 0 33 CLFT-type:4;JEL-type:8 CLFT-type:2;HET-rich:1;JEL-type:10 34.0 34.0 10 +JAQIHF010000007.1 1020000 1060000 40000 4 0.795 58 20 24 0 14 CLFT-type:10;JEL-type:10 CLFT-type:2;JEL-type:22 37.8 25.0 12 +JAQIHF010000007.1 1070000 1090000 20000 2 0.959 58 6 16 11 25 CLFT-type:6 CLFT-type:2;HET-rich:1;JEL-type:13 CLFT-type:2;JEL-type:9 46.8 9.0 9 +JAQIHF010000008.1 30000 50000 20000 2 0.942 58 9 17 0 32 CLFT-type:7;HET-rich:1;JEL-type:1 JEL-type:17 54.0 60.0 6 +JAQIHF010000008.1 140000 170000 30000 3 0.836 58 25 14 0 19 CLFT-type:12;JEL-type:13 JEL-type:14 36.5 39 16 +JAQIHF010000009.1 130000 150000 20000 2 1.0 58 22 3 0 33 CLFT-type:13;JEL-type:9 JEL-type:3 16.5 18.5 11 +JAQIHF010000009.1 460000 480000 20000 2 1.0 58 5 36 0 17 HET-rich:1;JEL-type:4 CLFT-type:9;JEL-type:27 16.8 16.0 7 +JAQIHF010000009.1 940000 960000 20000 2 1.0 58 5 45 0 8 CLFT-type:5 CLFT-type:5;HET-rich:1;JEL-type:39 35.5 0.5 7 +JAQIHF010000010.1 60000 100000 40000 4 0.823 58 28 16 0 14 CLFT-type:7;JEL-type:21 CLFT-type:5;HET-rich:1;JEL-type:10 40.8 37.0 14 +JAQIHF010000010.1 600000 630000 30000 3 0.72 58 14 24 0 20 CLFT-type:13;HET-rich:1 CLFT-type:1;JEL-type:23 21.5 29.0 8 +JAQIHF010000011.1 80000 100000 20000 2 0.987 58 41 5 0 12 CLFT-type:13;JEL-type:28 CLFT-type:2;JEL-type:3 45.0 46.5 5 +JAQIHF010000011.1 840000 860000 20000 2 0.981 58 6 36 0 16 CLFT-type:2;JEL-type:4 CLFT-type:11;JEL-type:25 28.5 27.2 11 +JAQIHF010000011.1 890000 910000 20000 2 0.479 58 14 10 0 34 JEL-type:14 CLFT-type:9;JEL-type:1 9.0 30.2 9 +JAQIHF010000012.1 70000 90000 20000 2 0.851 58 33 7 0 18 CLFT-type:11;JEL-type:22 JEL-type:7 56.5 73.0 5 +JAQIHF010000012.1 100000 120000 20000 2 1.0 58 16 22 0 20 CLFT-type:10;JEL-type:6 CLFT-type:2;JEL-type:20 54.0 43.5 7 +JAQIHF010000012.1 460000 480000 20000 2 1.0 58 7 13 0 38 CLFT-type:6;JEL-type:1 JEL-type:13 11.0 30.5 10 +JAQIHF010000012.1 780000 800000 20000 2 1.0 58 39 4 0 15 CLFT-type:14;HET-rich:1;JEL-type:24 JEL-type:4 28.8 44.5 6 +JAQIHF010000014.1 100000 120000 20000 2 0.966 58 10 12 1 35 CLFT-type:1;JEL-type:9 CLFT-type:5;HET-rich:1;JEL-type:6 CLFT-type:1 37.5 90.5 7 +JAQIHF010000014.1 440000 460000 20000 2 0.713 58 45 6 0 7 CLFT-type:11;HET-rich:1;JEL-type:33 CLFT-type:1;JEL-type:5 30.0 39.5 4 +JAQIHF010000014.1 650000 690000 40000 4 0.659 58 14 30 3 11 CLFT-type:9;JEL-type:5 HET-rich:1;JEL-type:29 CLFT-type:1;JEL-type:2 34.2 8.5 12 +JAQIHF010000015.1 20000 40000 20000 2 0.838 58 25 5 0 28 CLFT-type:2;JEL-type:23 JEL-type:5 23.0 22.5 4 +JAQIHF010000016.1 30000 60000 30000 3 1.0 58 31 4 0 23 CLFT-type:11;HET-rich:1;JEL-type:19 CLFT-type:1;JEL-type:3 0.0 6 12 +JAQIHF010000016.1 90000 110000 20000 2 1.0 58 14 14 0 30 CLFT-type:6;HET-rich:1;JEL-type:7 CLFT-type:3;JEL-type:11 43.2 23.5 8 +JAQIHF010000016.1 280000 300000 20000 2 0.833 58 8 36 1 13 CLFT-type:8 CLFT-type:1;JEL-type:35 CLFT-type:1 19.2 2.8 7 +JAQIHF010000016.1 380000 400000 20000 2 0.994 58 18 19 1 20 CLFT-type:11;HET-rich:1;JEL-type:6 CLFT-type:1;JEL-type:18 CLFT-type:1 53.5 16.2 8 +JAQIHF010000016.1 410000 460000 50000 5 0.386 58 13 27 13 5 CLFT-type:13 CLFT-type:1;JEL-type:26 CLFT-type:1;JEL-type:12 29 3 16 +JAQIHF010000017.1 250000 270000 20000 2 0.729 58 8 9 6 35 CLFT-type:8 CLFT-type:1;JEL-type:8 CLFT-type:1;HET-rich:1;JEL-type:4 12.5 5.2 9 +JAQIHF010000018.1 140000 170000 30000 3 0.993 58 40 13 0 5 CLFT-type:1;HET-rich:1;JEL-type:38 CLFT-type:13 25 25.0 12 +JAQIHF010000018.1 260000 280000 20000 2 0.628 58 11 19 6 22 CLFT-type:11 CLFT-type:1;HET-rich:1;JEL-type:17 JEL-type:6 17.0 13.5 5 +JAQIHF010000019.1 0 20000 20000 2 1.0 58 37 4 4 13 CLFT-type:2;HET-rich:1;JEL-type:34 CLFT-type:3;JEL-type:1 CLFT-type:4 1.5 30.0 8 +JAQIHF010000019.1 40000 70000 30000 3 0.466 58 50 6 0 2 CLFT-type:8;JEL-type:42 CLFT-type:6 6.0 13.5 13 +JAQIHF010000019.1 200000 220000 20000 2 1.0 58 8 30 1 19 CLFT-type:8 CLFT-type:4;HET-rich:1;JEL-type:25 JEL-type:1 4.0 1.5 3 +JAQIHF010000020.1 30000 60000 30000 3 0.828 58 10 25 2 21 CLFT-type:10 JEL-type:25 CLFT-type:2 24 25.5 11 +JAQIHF010000021.1 20000 40000 20000 2 0.986 58 14 29 0 15 CLFT-type:9;HET-rich:1;JEL-type:4 CLFT-type:1;JEL-type:28 38.0 7.5 9 +JAQIHF010000021.1 180000 200000 20000 2 0.0 58 20 10 0 28 CLFT-type:3;JEL-type:17 CLFT-type:6;JEL-type:4 8.2 13.5 6 +JAQIHF010000022.1 50000 70000 20000 2 0.958 58 8 34 3 13 CLFT-type:1;HET-rich:1;JEL-type:6 CLFT-type:4;JEL-type:30 CLFT-type:3 26.0 27.8 9 +JAQIHF010000023.1 200000 220000 20000 2 0.931 58 42 1 12 3 CLFT-type:2;JEL-type:40 CLFT-type:1 CLFT-type:12 24.5 43.8 5 +JAQIHF010000025.1 80000 100000 20000 2 0.675 58 6 5 40 7 CLFT-type:1;JEL-type:5 CLFT-type:1;JEL-type:4 CLFT-type:12;HET-rich:1;JEL-type:27 10.5 8.8 10 +JAQIHF010000025.1 130000 150000 20000 2 0.0 58 6 35 0 17 CLFT-type:1;HET-rich:1;JEL-type:4 CLFT-type:10;JEL-type:25 26.5 19.2 7 +JAQIHF010000026.1 60000 80000 20000 2 0.4 58 9 16 4 29 CLFT-type:9 CLFT-type:4;JEL-type:12 JEL-type:4 50.0 62.0 5 +JAQIHF010000030.1 70000 100000 30000 3 0.967 58 7 35 3 13 CLFT-type:4;JEL-type:3 CLFT-type:4;HET-rich:1;JEL-type:30 CLFT-type:3 37 14 6 +JAQIHF010000034.1 0 20000 20000 2 0.908 58 5 31 6 16 JEL-type:5 CLFT-type:5;HET-rich:1;JEL-type:25 CLFT-type:6 64.5 51.5 3 +JAQIHF010000035.1 10000 30000 20000 2 0.455 58 13 15 8 22 CLFT-type:3;JEL-type:10 CLFT-type:3;HET-rich:1;JEL-type:11 CLFT-type:1;JEL-type:7 0.0 0.0 6 +JAQIHF010000035.1 70000 90000 20000 2 0.0 58 10 16 10 22 CLFT-type:2;JEL-type:8 CLFT-type:4;JEL-type:12 CLFT-type:2;JEL-type:8 0.0 0.0 4 +JAQIHF010000036.1 20000 40000 20000 2 0.0 58 14 18 1 25 CLFT-type:4;JEL-type:10 CLFT-type:5;HET-rich:1;JEL-type:12 CLFT-type:1 28.2 42.0 3 +JAQIHF010000036.1 60000 80000 20000 2 0.637 58 17 10 10 21 JEL-type:17 CLFT-type:3;HET-rich:1;JEL-type:6 CLFT-type:10 7.0 8.5 3 +JAQIHF010000044.1 20000 40000 20000 2 0.827 58 29 4 0 25 CLFT-type:6;HET-rich:1;JEL-type:22 CLFT-type:2;JEL-type:2 21.5 36.5 3 +JAQIHF010000058.1 0 20000 20000 2 0.474 58 5 0 44 9 CLFT-type:5 CLFT-type:2;HET-rich:1;JEL-type:41 NA 0.0 6 +JAQIHF010000060.1 10000 30000 20000 2 0.0 58 10 17 5 26 JEL-type:10 CLFT-type:8;HET-rich:1;JEL-type:8 CLFT-type:5 52.0 98.5 10 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_regions_JEL423.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_regions_JEL423.tsv new file mode 100644 index 00000000..84c4be33 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/idiomorph_regions_JEL423.tsv @@ -0,0 +1,71 @@ +seq start end length windows aligned_to_other_ref n_isolates n_full n_half n_low n_other full_by_group half_by_group low_by_group het_median_half het_median_full n_genes keyword_genes +CP161923.1 20000 60000 40000 4 0.634 59 17 20 3 19 JEL-type:17 CLFT-type:12;JEL-type:8 JEL-type:3 43.5 27.5 10 +CP161923.1 1250000 1270000 20000 2 1.0 59 38 3 0 18 CLFT-type:13;HET-rich:1;JEL-type:24 JEL-type:3 13.0 11.2 8 +CP161923.1 3710000 3730000 20000 2 0.995 59 9 5 0 45 HET-rich:1;JEL-type:8 CLFT-type:3;JEL-type:2 31.5 2.0 9 +CP161923.1 3930000 3950000 20000 2 1.0 59 34 14 0 11 JEL-type:34 CLFT-type:13;HET-rich:1 47.2 12.8 6 +CP161923.1 4090000 4110000 20000 2 1.0 59 41 3 0 15 CLFT-type:12;HET-rich:1;JEL-type:28 JEL-type:3 0.0 0.5 8 +CP161923.1 4460000 4530000 70000 7 0.973 59 23 22 0 14 JEL-type:23 CLFT-type:13;JEL-type:9 45.0 23 25 +CP161924.1 250000 270000 20000 2 1.0 59 19 24 0 16 JEL-type:19 CLFT-type:13;JEL-type:11 45.0 40.5 6 +CP161924.1 280000 300000 20000 2 1.0 59 12 30 0 17 CLFT-type:3;JEL-type:9 CLFT-type:8;JEL-type:22 45.0 45.5 6 +CP161924.1 680000 700000 20000 2 0.87 59 13 21 0 25 CLFT-type:2;HET-rich:1;JEL-type:10 CLFT-type:7;JEL-type:14 1.5 2.0 7 +CP161924.1 1200000 1230000 30000 3 0.996 59 32 13 0 14 JEL-type:32 CLFT-type:13 104 6.0 9 +CP161924.1 1370000 1390000 20000 2 1.0 59 38 3 1 17 CLFT-type:3;HET-rich:1;JEL-type:34 CLFT-type:3 CLFT-type:1 67.5 16.2 3 +CP161925.1 10000 30000 20000 2 0.897 59 7 16 26 10 JEL-type:7 JEL-type:16 CLFT-type:15;HET-rich:1;JEL-type:10 2.8 2.0 4 +CP161925.1 110000 140000 30000 3 0.655 59 34 14 0 11 JEL-type:34 CLFT-type:14 65.5 19.5 11 +CP161925.1 160000 180000 20000 2 1.0 59 22 3 0 34 CLFT-type:3;JEL-type:19 CLFT-type:1;JEL-type:2 21.0 6.5 9 +CP161925.1 220000 270000 50000 5 0.887 59 10 36 2 11 CLFT-type:1;HET-rich:1;JEL-type:8 CLFT-type:10;JEL-type:26 JEL-type:2 36.0 7.5 13 +CP161925.1 910000 930000 20000 2 1.0 59 27 13 0 19 JEL-type:27 CLFT-type:13 20.0 6.5 8 +CP161925.1 1460000 1480000 20000 2 1.0 59 28 4 0 27 CLFT-type:12;HET-rich:1;JEL-type:15 CLFT-type:1;JEL-type:3 2.5 41.8 4 +CP161925.1 1830000 1870000 40000 4 0.993 59 35 12 0 12 HET-rich:1;JEL-type:34 CLFT-type:12 77.0 11.5 10 +CP161925.1 1960000 1980000 20000 2 1.0 59 14 20 0 25 JEL-type:14 CLFT-type:11;HET-rich:1;JEL-type:8 42.2 17.8 5 +CP161925.1 2030000 2050000 20000 2 0.97 59 18 8 17 16 JEL-type:18 JEL-type:8 CLFT-type:14;JEL-type:3 3.2 3.0 2 +CP161926.1 50000 80000 30000 3 0.723 59 24 13 4 18 JEL-type:24 CLFT-type:3;HET-rich:1;JEL-type:9 CLFT-type:4 12 16.0 8 +CP161926.1 1430000 1450000 20000 2 1.0 59 10 30 0 19 CLFT-type:1;JEL-type:9 CLFT-type:13;JEL-type:17 0.2 0.0 8 +CP161926.1 1760000 1790000 30000 3 0.822 59 19 17 5 18 CLFT-type:1;HET-rich:1;JEL-type:17 CLFT-type:13;JEL-type:4 JEL-type:5 50 17 7 +CP161927.1 10000 30000 20000 2 0.897 59 22 12 2 23 JEL-type:22 CLFT-type:6;JEL-type:6 HET-rich:1;JEL-type:1 66.8 10.8 6 +CP161927.1 300000 340000 40000 4 0.922 59 25 14 0 20 CLFT-type:3;JEL-type:22 CLFT-type:2;HET-rich:1;JEL-type:11 10.2 10.0 13 +CP161927.1 730000 750000 20000 2 0.956 59 38 6 0 15 CLFT-type:12;HET-rich:1;JEL-type:25 JEL-type:6 30.0 47.8 9 +CP161927.1 950000 970000 20000 2 1.0 59 44 3 0 12 CLFT-type:14;HET-rich:1;JEL-type:29 JEL-type:3 5.5 8.0 4 +CP161927.1 1610000 1630000 20000 2 0.994 59 38 3 0 18 CLFT-type:14;JEL-type:24 JEL-type:3 12.5 71.2 10 +CP161927.1 1720000 1750000 30000 3 0.312 59 24 6 0 29 CLFT-type:5;JEL-type:19 CLFT-type:1;JEL-type:5 43.5 56.5 11 +CP161927.1 1760000 1780000 20000 2 0.344 59 7 17 13 22 JEL-type:7 CLFT-type:1;JEL-type:16 CLFT-type:12;JEL-type:1 11.0 4.0 1 +CP161928.1 160000 180000 20000 2 1.0 59 6 34 2 17 JEL-type:6 CLFT-type:13;HET-rich:1;JEL-type:20 CLFT-type:2 8.0 3.5 8 +CP161928.1 350000 390000 40000 4 1.0 59 15 28 0 16 JEL-type:15 CLFT-type:14;JEL-type:14 24.5 23.0 15 +CP161928.1 1250000 1280000 30000 3 0.984 59 14 21 0 24 JEL-type:14 CLFT-type:12;HET-rich:1;JEL-type:8 43 23.5 11 +CP161928.1 1430000 1450000 20000 2 0.97 59 8 15 0 36 CLFT-type:2;HET-rich:1;JEL-type:5 CLFT-type:4;JEL-type:11 58.5 64.2 6 +CP161928.1 1550000 1590000 40000 4 0.782 59 23 12 3 21 CLFT-type:1;HET-rich:1;JEL-type:21 CLFT-type:5;JEL-type:7 CLFT-type:1;JEL-type:2 18.5 7.5 11 +CP161929.1 30000 80000 50000 5 0.826 59 38 7 0 14 CLFT-type:5;HET-rich:1;JEL-type:32 CLFT-type:5;JEL-type:2 78 37.5 17 +CP161929.1 1160000 1190000 30000 3 0.71 59 7 33 0 19 JEL-type:7 CLFT-type:12;HET-rich:1;JEL-type:20 62 44 12 +CP161929.1 1290000 1340000 50000 5 1.0 59 32 17 1 9 JEL-type:32 CLFT-type:14;JEL-type:3 CLFT-type:1 31 23.5 12 +CP161929.1 1450000 1470000 20000 2 1.0 59 11 15 1 32 CLFT-type:1;JEL-type:10 JEL-type:15 JEL-type:1 13.5 22.0 3 +CP161929.1 1480000 1500000 20000 2 0.141 59 11 11 12 25 HET-rich:1;JEL-type:10 CLFT-type:1;JEL-type:10 CLFT-type:9;JEL-type:3 4.0 4.0 1 +CP161930.1 900000 920000 20000 2 0.991 59 14 28 0 17 JEL-type:14 CLFT-type:13;HET-rich:1;JEL-type:14 31.8 14.2 11 +CP161930.1 1030000 1050000 20000 2 0.563 59 29 3 0 27 CLFT-type:10;HET-rich:1;JEL-type:18 JEL-type:3 18.5 19.0 6 +CP161930.1 1260000 1290000 30000 3 0.992 59 7 15 0 37 CLFT-type:1;JEL-type:6 CLFT-type:4;HET-rich:1;JEL-type:10 74 82 10 +CP161930.1 1300000 1320000 20000 2 1.0 59 11 31 7 10 CLFT-type:11 CLFT-type:2;HET-rich:1;JEL-type:28 JEL-type:7 58.5 80.5 3 +CP161931.1 20000 50000 30000 3 1.0 59 19 7 13 20 JEL-type:19 CLFT-type:5;HET-rich:1;JEL-type:1 CLFT-type:8;JEL-type:5 41 17 9 +CP161931.1 130000 150000 20000 2 0.481 59 28 3 0 28 CLFT-type:4;JEL-type:24 CLFT-type:2;JEL-type:1 31.5 21.5 7 +CP161931.1 160000 200000 40000 4 0.993 59 31 12 0 16 HET-rich:1;JEL-type:30 CLFT-type:11;JEL-type:1 60.5 19.5 14 +CP161931.1 250000 270000 20000 2 0.94 59 23 9 0 27 CLFT-type:1;HET-rich:1;JEL-type:21 CLFT-type:9 53.0 15.0 7 +CP161932.1 60000 80000 20000 2 0.679 59 9 15 0 35 CLFT-type:1;HET-rich:1;JEL-type:7 CLFT-type:4;JEL-type:11 68.5 58.0 7 +CP161932.1 1010000 1060000 50000 5 0.499 59 29 16 0 14 CLFT-type:4;JEL-type:25 CLFT-type:8;JEL-type:8 41.5 26 10 +CP161933.1 20000 40000 20000 2 0.949 59 12 19 1 27 CLFT-type:2;HET-rich:1;JEL-type:9 CLFT-type:3;JEL-type:16 JEL-type:1 22.0 20.8 2 +CP161933.1 50000 70000 20000 2 0.575 59 19 9 0 31 CLFT-type:2;JEL-type:17 CLFT-type:1;JEL-type:8 48.0 47.0 6 +CP161933.1 750000 770000 20000 2 1.0 59 21 11 0 27 CLFT-type:7;JEL-type:14 CLFT-type:1;HET-rich:1;JEL-type:9 2.5 3.0 10 +CP161933.1 970000 1050000 80000 8 0.788 59 17 28 0 14 CLFT-type:5;JEL-type:12 CLFT-type:6;HET-rich:1;JEL-type:21 42.8 53.0 17 +CP161934.1 20000 40000 20000 2 0.654 59 32 8 0 19 JEL-type:32 CLFT-type:8 51.0 17.0 4 +CP161934.1 330000 350000 20000 2 1.0 59 37 15 0 7 JEL-type:37 CLFT-type:14;HET-rich:1 70.5 25.0 4 +CP161934.1 1000000 1050000 50000 5 0.797 59 21 19 0 19 JEL-type:21 CLFT-type:13;HET-rich:1;JEL-type:5 50 31 12 +CP161935.1 20000 40000 20000 2 1.0 59 10 8 23 18 CLFT-type:10 CLFT-type:3;JEL-type:5 JEL-type:23 33.8 49.5 5 +CP161935.1 170000 200000 30000 3 0.978 59 17 15 0 27 CLFT-type:2;JEL-type:15 CLFT-type:8;JEL-type:7 61 88 10 +CP161935.1 780000 800000 20000 2 0.737 59 35 7 0 17 CLFT-type:3;HET-rich:1;JEL-type:31 CLFT-type:7 60.5 30.0 5 +CP161936.1 700000 770000 70000 7 0.095 59 25 17 3 14 HET-rich:1;JEL-type:24 CLFT-type:13;JEL-type:4 JEL-type:3 49 19 21 +CP161936.1 780000 820000 40000 4 0.989 59 22 13 5 19 CLFT-type:3;JEL-type:19 CLFT-type:3;JEL-type:10 CLFT-type:1;JEL-type:4 20.5 17.8 10 +CP161937.1 50000 100000 50000 5 0.496 59 30 5 1 23 CLFT-type:4;JEL-type:26 CLFT-type:3;JEL-type:2 JEL-type:1 42 47.0 15 +CP161937.1 210000 250000 40000 4 0.928 59 13 11 0 35 CLFT-type:3;JEL-type:10 CLFT-type:9;JEL-type:2 54.0 29.0 12 +CP161937.1 310000 340000 30000 3 0.954 59 25 5 0 29 CLFT-type:7;HET-rich:1;JEL-type:17 CLFT-type:1;JEL-type:4 31 41 8 +CP161937.1 680000 730000 50000 5 0.568 59 29 8 2 20 CLFT-type:2;HET-rich:1;JEL-type:26 CLFT-type:7;JEL-type:1 JEL-type:2 63.5 34 14 +CP161938.1 350000 370000 20000 2 0.274 59 14 14 2 29 JEL-type:14 CLFT-type:6;HET-rich:1;JEL-type:7 CLFT-type:2 39.0 40.8 4 +CP161938.1 460000 480000 20000 2 0.745 59 37 11 0 11 CLFT-type:2;JEL-type:35 CLFT-type:11 57.0 44.5 6 +CP161939.1 0 70000 70000 7 0.983 59 20 19 0 20 HET-rich:1;JEL-type:19 CLFT-type:7;JEL-type:12 13 9.5 19 +CP161939.1 80000 100000 20000 2 0.993 59 25 18 1 15 JEL-type:25 CLFT-type:12;HET-rich:1;JEL-type:5 CLFT-type:1 31.2 9.5 5 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/isolate_classes.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/isolate_classes.tsv new file mode 100644 index 00000000..3bd430ad --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/isolate_classes.tsv @@ -0,0 +1,70 @@ +run group isolate country class median_depth snps_per_mb_JEL423 snps_per_mb_CLFT044 +SRR10698394 brazil CLFT156 Brazil JEL-type 31.3 1706.3 4015.7 +SRR10698397 brazil CLFT139 Brazil CLFT-type 41.1 5568.2 1728.1 +SRR10698399 brazil CLFT133 Brazil JEL-type 34.9 2119.4 4866.4 +SRR10698402 brazil CLFT130 Brazil JEL-type 14.3 909.8 2161.9 +SRR10698405 brazil CLFT126 Brazil JEL-type 22.7 1888.6 4362.9 +SRR10698410 brazil CLFT107 Brazil JEL-type 22.2 1604.3 3947.6 +SRR10698414 brazil CLFT043 Brazil JEL-type 34.8 1905.5 4382.8 +SRR10698421 brazil CLFT078 Brazil JEL-type 47.9 2124.1 4658.0 +SRR6375563 brazil CLFT061 Brazil CLFT-type 28.1 5570.0 1783.7 +SRR10698382 brazil CLFT063 Brazil JEL-type 39.0 2044.2 4547.8 +SRR10698383 brazil CLFT062 Brazil JEL-type 21.6 1825.8 4077.5 +SRR10698385 brazil CLFT048 Brazil JEL-type 24.7 2066.1 4590.0 +SRR10698389 brazil CLFT165 Brazil CLFT-type 23.6 4265.2 2378.4 +SRR10698404 brazil CLFT129 Brazil JEL-type 15.9 1348.7 3140.2 +SRR10698406 brazil CLFT123 Brazil JEL-type 17.2 1411.5 3539.8 +SRR10698407 brazil CLFT120 Brazil JEL-type 16.4 1280.8 3081.1 +SRR10698422 brazil CLFT075 Brazil JEL-type 32.3 1940.4 4392.9 +SRR6375565 brazil CLFT067 Brazil CLFT-type 51.8 5923.2 2134.1 +SRR6375567 brazil CLFT071 Brazil CLFT-type 35.6 5759.5 2039.8 +SRR10698388 brazil CLFT166 Brazil JEL-type 28.3 1386.0 3587.5 +SRR10698392 brazil CLFT045 Brazil JEL-type 37.0 2146.2 4903.4 +SRR10698395 brazil CLFT152 Brazil JEL-type 28.5 2130.9 4446.1 +SRR10698403 brazil CLFT044 Brazil CLFT-type 40.1 5399.1 1356.8 +SRR10698408 brazil CLFT114 Brazil JEL-type 21.4 1532.2 3610.2 +SRR10698411 brazil CLFT101 Brazil JEL-type 24.8 1528.9 3730.0 +SRR10698417 brazil CLFT086 Brazil JEL-type 33.3 2119.2 4773.9 +SRR10698418 brazil CLFT085 Brazil JEL-type 29.3 1898.7 4353.6 +SRR10698384 brazil CLFT060 Brazil JEL-type 33.2 2008.0 4598.6 +SRR10698391 brazil CLFT160 Brazil HET-rich 27.5 4593.9 3939.5 +SRR10698393 brazil CLFT157 Brazil JEL-type 24.7 1554.1 3925.1 +SRR10698396 brazil CLFT148 Brazil CLFT-type 27.0 5349.6 1644.6 +SRR10698400 brazil CLFT132 Brazil JEL-type 17.6 1508.7 3466.6 +SRR10698412 brazil CLFT100 Brazil JEL-type 22.7 1603.4 3882.5 +SRR10698420 brazil CLFT080 Brazil JEL-type 38.4 2066.2 4776.9 +SRR10698423 brazil CLFT073 Brazil JEL-type 20.5 1807.9 4190.3 +SRR10698425 brazil CLFT039 Brazil HET-rich 16.2 3874.4 3429.5 +SRR10698381 brazil CLFT068 Brazil CLFT-type 35.7 5789.7 1979.2 +SRR10698387 brazil CLFT167 Brazil JEL-type 25.1 1679.3 3819.5 +SRR10698390 brazil CLFT163 Brazil JEL-type 29.3 2111.2 4621.9 +SRR10698398 brazil CLFT138 Brazil JEL-type 29.2 1816.7 4232.8 +SRR10698401 brazil CLFT131 Brazil JEL-type 32.9 2025.9 4602.3 +SRR10698409 brazil CLFT111 Brazil JEL-type 30.8 1896.0 4744.1 +SRR10698413 brazil CLFT097 Brazil JEL-type 29.8 1994.8 4514.7 +SRR10698415 brazil CLFT095 Brazil JEL-type 40.2 2101.8 4839.8 +SRR10698416 brazil CLFT088 Brazil JEL-type 17.0 1462.4 3408.7 +SRR10698419 brazil CLFT082 Brazil JEL-type 17.3 1605.5 3611.7 +SRR10698424 brazil CLFT070 Brazil CLFT-type 37.8 5861.9 2009.9 +SRR10698426 brazil CLFT037 Brazil JEL-type 19.1 1762.1 4268.1 +SRR6375524 brazil CLFT001 Brazil CLFT-type 61.9 5772.7 1871.5 +SRR6375564 brazil CLFT065 Brazil CLFT-type 54.9 5901.3 2032.7 +SRR6375566 brazil CLFT144 Brazil CLFT-type 24.6 4854.7 1654.2 +SRR6375571 brazil CLFT136 Brazil CLFT-type 37.8 5650.5 1639.0 +SRR6375476 other 06.OZ Australia JEL-type 89.8 2255.9 4970.6 +SRR6375485 other JEL261 Canada JEL-type 178.6 2345.3 4416.3 +SRR630411 other Generic sample from B. dendrobatis Ethiopia: Telilia Stream near Rira JEL-type 93.3 2297.2 4739.9 +SRR6375463 other FG32 French Guiana JEL-type 127.0 2000.9 4682.1 +SRR6375491 other Hung_2014 Hungary JEL-type 123.9 2515.3 4875.4 +SRR633648 other Generic sample from B. dendrobatis Italy: Sardinia, Affluente Pisharoni JEL-type 108.3 2066.3 4652.5 +SRR6375514 other L2203 Montserrat JEL-type 82.1 2231.8 4843.0 +SRR6375457 other BdNL1 Netherlands JEL-type 42.1 2249.9 4891.9 +SRR7825135 other RTP5 New Zealand: Dunedin JEL-type 71.5 1838.7 4583.1 +SRR6375517 other JEL423 Panama JEL-type 150.4 1851.2 4611.6 +SRR1639274 other JEL427-P17 Puerto Rico: El Yunque National Forest JEL-type 10.8 1164.7 2418.6 +SRR6375481 other 08MG05 South Africa JEL-type 155.2 2194.7 4806.9 +SRR6375579 other KRBOOR_331 South Korea CLFT-type 175.0 6472.1 5103.9 +SRR6375494 other SWED-40.5.13 Sweden JEL-type 42.7 2272.2 4923.1 +SRR630414 other Generic sample from B. dendrobatis Switzerland: Gamlikon CLFT-type 86.2 5091.5 4115.0 +SRR6375448 other TW16-292 Taiwan JEL-type 43.3 2282.8 5003.4 +SRR6378438 other UKBER United Kingdom JEL-type 105.0 2095.6 4120.6 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/parent_origin_summary.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/parent_origin_summary.tsv new file mode 100644 index 00000000..a2aded28 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/parent_origin_summary.tsv @@ -0,0 +1,70 @@ +run group isolate country usable_sites called_sites recovery het_share_of_called windows windows_CLFT windows_HET windows_JELHOM switches +SRR10698394 brazil CLFT156 Brazil 138650 90972 0.6561 0.2103 453 98 4 351 87 +SRR10698397 brazil CLFT139 Brazil 152832 21460 0.1404 0.8584 470 462 8 0 14 +SRR10698399 brazil CLFT133 Brazil 149010 97474 0.6541 0.2429 463 100 3 360 84 +SRR10698402 brazil CLFT130 Brazil 119946 79620 0.6638 0.1752 445 89 0 356 87 +SRR10698405 brazil CLFT126 Brazil 122901 86752 0.7059 0.238 437 80 4 353 89 +SRR10698410 brazil CLFT107 Brazil 138397 90082 0.6509 0.2251 457 106 4 347 97 +SRR10698414 brazil CLFT043 Brazil 144335 95702 0.6631 0.2419 460 98 4 358 84 +SRR10698421 brazil CLFT078 Brazil 151307 98544 0.6513 0.2562 468 105 5 358 94 +SRR6375563 brazil CLFT061 Brazil 149719 21143 0.1412 0.8703 461 451 8 2 18 +SRR10698382 brazil CLFT063 Brazil 148121 95492 0.6447 0.2509 463 108 4 351 102 +SRR10698383 brazil CLFT062 Brazil 141560 90406 0.6386 0.2244 455 108 2 345 109 +SRR10698385 brazil CLFT048 Brazil 134498 88400 0.6573 0.2338 448 100 4 344 108 +SRR10698389 brazil CLFT165 Brazil 142910 44807 0.3135 0.7402 456 300 148 8 79 +SRR10698404 brazil CLFT129 Brazil 107938 78043 0.723 0.1808 433 64 3 366 76 +SRR10698406 brazil CLFT123 Brazil 106766 79822 0.7476 0.1931 428 65 5 358 73 +SRR10698407 brazil CLFT120 Brazil 121103 82135 0.6782 0.1803 440 81 4 355 91 +SRR10698422 brazil CLFT075 Brazil 141662 91233 0.644 0.2157 454 102 4 348 98 +SRR6375565 brazil CLFT067 Brazil 156794 25601 0.1633 0.8472 471 460 9 2 20 +SRR6375567 brazil CLFT071 Brazil 152020 24644 0.1621 0.8054 466 456 9 1 18 +SRR10698388 brazil CLFT166 Brazil 131660 87127 0.6618 0.1832 450 96 2 352 95 +SRR10698392 brazil CLFT045 Brazil 148128 96628 0.6523 0.2445 462 97 4 361 87 +SRR10698395 brazil CLFT152 Brazil 139021 92829 0.6677 0.2704 451 96 4 351 97 +SRR10698403 brazil CLFT044 Brazil 154146 17115 0.111 0.9434 470 467 3 0 6 +SRR10698408 brazil CLFT114 Brazil 132307 85708 0.6478 0.1869 448 101 4 343 106 +SRR10698411 brazil CLFT101 Brazil 138651 90219 0.6507 0.2281 452 108 5 339 107 +SRR10698417 brazil CLFT086 Brazil 148067 96642 0.6527 0.2435 461 97 5 359 84 +SRR10698418 brazil CLFT085 Brazil 143070 93983 0.6569 0.2439 461 104 4 353 92 +SRR10698384 brazil CLFT060 Brazil 147418 96565 0.655 0.2371 461 93 7 361 90 +SRR10698391 brazil CLFT160 Brazil 144522 77590 0.5369 0.8059 457 152 277 28 128 +SRR10698393 brazil CLFT157 Brazil 138022 89813 0.6507 0.2079 454 104 2 348 96 +SRR10698396 brazil CLFT148 Brazil 148040 20738 0.1401 0.8634 462 453 9 0 15 +SRR10698400 brazil CLFT132 Brazil 131568 85917 0.653 0.2159 452 104 1 347 102 +SRR10698412 brazil CLFT100 Brazil 134991 89177 0.6606 0.2279 452 101 4 347 101 +SRR10698420 brazil CLFT080 Brazil 152430 96120 0.6306 0.226 465 107 3 355 95 +SRR10698423 brazil CLFT073 Brazil 132162 86758 0.6565 0.214 446 94 4 348 96 +SRR10698425 brazil CLFT039 Brazil 122428 69345 0.5664 0.7422 432 102 292 38 123 +SRR10698381 brazil CLFT068 Brazil 152090 23802 0.1565 0.8907 466 457 9 0 16 +SRR10698387 brazil CLFT167 Brazil 134628 89272 0.6631 0.2427 449 96 4 349 96 +SRR10698390 brazil CLFT163 Brazil 138305 92593 0.6695 0.239 449 86 6 357 86 +SRR10698398 brazil CLFT138 Brazil 135578 92081 0.6792 0.2274 449 89 5 355 81 +SRR10698401 brazil CLFT131 Brazil 142493 95094 0.6674 0.2454 455 93 4 358 85 +SRR10698409 brazil CLFT111 Brazil 144413 94898 0.6571 0.2218 458 95 5 358 85 +SRR10698413 brazil CLFT097 Brazil 140449 93209 0.6637 0.2272 453 90 6 357 86 +SRR10698415 brazil CLFT095 Brazil 150838 97822 0.6485 0.2417 465 95 6 364 86 +SRR10698416 brazil CLFT088 Brazil 132954 86495 0.6506 0.2156 453 105 2 346 107 +SRR10698419 brazil CLFT082 Brazil 117048 80969 0.6918 0.1921 437 84 2 351 96 +SRR10698424 brazil CLFT070 Brazil 151124 23878 0.158 0.893 464 454 10 0 18 +SRR10698426 brazil CLFT037 Brazil 125997 88048 0.6988 0.2148 439 77 3 359 81 +SRR6375524 brazil CLFT001 Brazil 157484 23270 0.1478 0.7203 475 467 7 1 16 +SRR6375564 brazil CLFT065 Brazil 158500 25149 0.1587 0.8719 473 464 9 0 16 +SRR6375566 brazil CLFT144 Brazil 148714 22908 0.154 0.9295 463 454 9 0 16 +SRR6375571 brazil CLFT136 Brazil 152863 19918 0.1303 0.8714 469 462 6 1 14 +SRR6375476 other 06.OZ Australia 161042 107673 0.6686 0.2794 480 98 13 369 92 +SRR6375485 other JEL261 Canada 162442 100980 0.6216 0.2838 482 112 10 360 95 +SRR630411 other Generic sample from B. dendrobatis Ethiopia: Telilia Stream near Rira 158346 96275 0.608 0.2624 477 131 7 339 119 +SRR6375463 other FG32 French Guiana 162619 106723 0.6563 0.2471 481 99 12 370 88 +SRR6375491 other Hung_2014 Hungary 162519 107374 0.6607 0.2907 482 99 12 371 84 +SRR633648 other Generic sample from B. dendrobatis Italy: Sardinia, Affluente Pisharoni 160121 99276 0.62 0.2581 479 124 6 349 98 +SRR6375514 other L2203 Montserrat 160168 105940 0.6614 0.2645 481 98 8 375 84 +SRR6375457 other BdNL1 Netherlands 148639 100370 0.6753 0.2477 463 86 7 370 77 +SRR7825135 other RTP5 New Zealand: Dunedin 156777 102268 0.6523 0.2362 475 107 6 362 89 +SRR6375517 other JEL423 Panama 162201 107151 0.6606 0.2728 482 104 12 366 100 +SRR1639274 other JEL427-P17 Puerto Rico: El Yunque National Forest 96304 62099 0.6448 0.2735 419 79 14 326 91 +SRR6375481 other 08MG05 South Africa 163449 109706 0.6712 0.2792 483 95 15 373 88 +SRR6375579 other KRBOOR_331 South Korea 161641 59362 0.3672 0.4199 480 350 8 122 168 +SRR6375494 other SWED-40.5.13 Sweden 148424 102278 0.6891 0.2697 464 82 10 372 85 +SRR630414 other Generic sample from B. dendrobatis Switzerland: Gamlikon 155707 50872 0.3267 0.3347 473 377 1 95 112 +SRR6375448 other TW16-292 Taiwan 149478 102965 0.6888 0.2688 464 82 12 370 84 +SRR6378438 other UKBER United Kingdom 158900 101218 0.637 0.2776 476 111 5 360 93 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/pca_scores.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/pca_scores.tsv new file mode 100644 index 00000000..3b179975 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/pca_scores.tsv @@ -0,0 +1,70 @@ +run isolate class group PC1 PC2 PC3 PC4 sites_called +SRR10698394 CLFT156 JEL-type brazil -14.14 -6.88 7.51 -2.43 8579 +SRR10698397 CLFT139 CLFT-type brazil 51.53 3.40 2.59 3.13 3719 +SRR10698399 CLFT133 JEL-type brazil -21.82 5.27 3.20 1.84 10184 +SRR10698402 CLFT130 JEL-type brazil 17.53 -17.81 -14.35 2.79 4527 +SRR10698405 CLFT126 JEL-type brazil -16.60 1.34 4.40 -1.33 9311 +SRR10698410 CLFT107 JEL-type brazil -10.78 -11.84 -8.81 2.58 8314 +SRR10698414 CLFT043 JEL-type brazil -16.84 -0.33 6.64 -1.25 9277 +SRR10698421 CLFT078 JEL-type brazil -20.15 -1.28 6.33 -0.36 9950 +SRR6375563 CLFT061 CLFT-type brazil 50.70 3.51 2.14 2.70 3900 +SRR10698382 CLFT063 JEL-type brazil -17.64 -4.57 11.10 -2.58 9563 +SRR10698383 CLFT062 JEL-type brazil -12.66 -11.48 4.38 -1.72 8581 +SRR10698385 CLFT048 JEL-type brazil -18.99 2.34 4.73 -0.15 9678 +SRR10698389 CLFT165 CLFT-type brazil 38.40 -0.95 1.64 3.88 5134 +SRR10698404 CLFT129 JEL-type brazil -1.52 -16.83 2.30 -4.00 6689 +SRR10698406 CLFT123 JEL-type brazil -8.56 -5.87 -0.21 -1.47 7728 +SRR10698407 CLFT120 JEL-type brazil 0.78 -13.88 -13.76 4.21 6521 +SRR10698422 CLFT075 JEL-type brazil -17.31 -0.47 14.63 -3.82 9238 +SRR6375565 CLFT067 CLFT-type brazil 51.41 4.56 2.93 3.07 4640 +SRR6375567 CLFT071 CLFT-type brazil 51.39 4.80 3.33 3.59 4389 +SRR10698388 CLFT166 JEL-type brazil -8.99 -6.25 4.77 -3.24 7728 +SRR10698392 CLFT045 JEL-type brazil -21.67 5.35 4.01 1.37 10217 +SRR10698395 CLFT152 JEL-type brazil -13.33 -4.63 -2.04 -4.02 9360 +SRR10698403 CLFT044 CLFT-type brazil 51.03 0.13 0.48 2.61 2804 +SRR10698408 CLFT114 JEL-type brazil -8.99 -14.12 -6.36 0.12 7608 +SRR10698411 CLFT101 JEL-type brazil -7.13 -10.55 -11.44 2.67 7934 +SRR10698417 CLFT086 JEL-type brazil -20.86 4.82 7.70 0.81 9951 +SRR10698418 CLFT085 JEL-type brazil -15.67 -7.68 9.71 -3.03 9157 +SRR10698384 CLFT060 JEL-type brazil -20.27 -1.69 7.65 -0.05 9683 +SRR10698391 CLFT160 HET-rich brazil 16.53 -1.73 -3.28 2.21 8262 +SRR10698393 CLFT157 JEL-type brazil -13.19 -10.25 -3.38 1.01 8425 +SRR10698396 CLFT148 CLFT-type brazil 51.48 2.74 2.60 2.95 3551 +SRR10698400 CLFT132 JEL-type brazil -2.84 -16.71 -8.12 3.05 7283 +SRR10698412 CLFT100 JEL-type brazil -10.64 -10.46 -8.72 2.75 8278 +SRR10698420 CLFT080 JEL-type brazil -21.05 3.03 10.78 -1.30 9907 +SRR10698423 CLFT073 JEL-type brazil -14.47 -9.04 10.91 -3.95 8788 +SRR10698425 CLFT039 HET-rich brazil 21.12 -3.20 5.59 -1.05 7410 +SRR10698381 CLFT068 CLFT-type brazil 51.37 4.19 2.54 3.22 4330 +SRR10698387 CLFT167 JEL-type brazil -8.76 -8.21 1.61 -2.43 8200 +SRR10698390 CLFT163 JEL-type brazil -17.87 7.45 -4.90 0.01 9706 +SRR10698398 CLFT138 JEL-type brazil -16.85 -0.17 4.56 -1.18 9073 +SRR10698401 CLFT131 JEL-type brazil -20.00 2.05 2.71 0.29 9730 +SRR10698409 CLFT111 JEL-type brazil -21.78 5.74 -0.32 3.34 9875 +SRR10698413 CLFT097 JEL-type brazil -20.56 2.21 0.49 1.85 9582 +SRR10698415 CLFT095 JEL-type brazil -21.82 4.92 -0.14 2.99 10103 +SRR10698416 CLFT088 JEL-type brazil -0.97 -15.30 -9.79 1.50 7085 +SRR10698419 CLFT082 JEL-type brazil -7.56 -13.34 13.06 -5.01 7615 +SRR10698424 CLFT070 CLFT-type brazil 51.21 4.21 2.45 3.22 4357 +SRR10698426 CLFT037 JEL-type brazil -16.34 -4.54 1.91 0.58 8936 +SRR6375524 CLFT001 CLFT-type brazil 51.92 4.81 2.74 4.19 4042 +SRR6375564 CLFT065 CLFT-type brazil 51.39 4.02 2.74 3.32 4342 +SRR6375566 CLFT144 CLFT-type brazil 51.01 0.54 0.79 2.63 3636 +SRR6375571 CLFT136 CLFT-type brazil 51.74 2.89 1.87 3.40 3474 +SRR6375476 06.OZ JEL-type other -22.66 9.34 -0.34 3.37 10439 +SRR6375485 JEL261 JEL-type other -16.25 9.54 -9.95 -3.30 9488 +SRR630411 Generic sample from B. dendrobatis JEL-type other -18.13 7.74 -5.77 -1.03 9898 +SRR6375463 FG32 JEL-type other -22.38 9.85 -1.26 4.14 9941 +SRR6375491 Hung_2014 JEL-type other -20.36 12.52 -9.50 1.86 10422 +SRR633648 Generic sample from B. dendrobatis JEL-type other -19.73 4.80 -0.44 0.37 9819 +SRR6375514 L2203 JEL-type other -22.47 10.24 -1.21 4.15 10302 +SRR6375457 BdNL1 JEL-type other -19.95 15.79 -11.38 2.45 10222 +SRR7825135 RTP5 JEL-type other -20.82 9.71 -1.93 3.66 9727 +SRR6375517 JEL423 JEL-type other -20.77 8.91 -4.09 3.35 9799 +SRR1639274 JEL427-P17 JEL-type other 23.55 -4.29 -6.51 2.30 4697 +SRR6375481 08MG05 JEL-type other -22.50 9.16 -1.11 3.74 10195 +SRR6375579 KRBOOR_331 CLFT-type other 25.77 9.98 -7.20 -31.88 11049 +SRR6375494 SWED-40.5.13 JEL-type other -22.21 9.91 -2.47 3.80 10369 +SRR630414 Generic sample from B. dendrobatis CLFT-type other 28.45 5.57 -7.36 -31.30 8785 +SRR6375448 TW16-292 JEL-type other -22.80 9.80 -2.05 4.35 10455 +SRR6378438 UKBER JEL-type other -8.66 7.18 -11.36 -3.49 8861 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/pca_variance.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/pca_variance.tsv new file mode 100644 index 00000000..9f1deaab --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/pca_variance.tsv @@ -0,0 +1,7 @@ +PC variance_share +PC1 0.4730 +PC2 0.0429 +PC3 0.0275 +PC4 0.0236 +PC5 0.0217 +PC6 0.0187 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/site_genotype_by_sequence.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/site_genotype_by_sequence.tsv new file mode 100644 index 00000000..78908769 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/site_genotype_by_sequence.tsv @@ -0,0 +1,127 @@ +run isolate seq length sites share_clft share_het share_jel +SRR10698388 CLFT166 JAQIHF010000001.1 4271105 18105 0.139 0.073 0.788 +SRR10698388 CLFT166 JAQIHF010000002.1 2429103 8789 0.139 0.250 0.611 +SRR10698388 CLFT166 JAQIHF010000003.1 1821279 7507 0.155 0.176 0.668 +SRR10698388 CLFT166 JAQIHF010000004.1 1449457 5712 0.136 0.093 0.771 +SRR10698388 CLFT166 JAQIHF010000005.1 1292353 4747 0.142 0.174 0.684 +SRR10698388 CLFT166 JAQIHF010000006.1 1130921 5676 0.202 0.190 0.608 +SRR10698388 CLFT166 JAQIHF010000007.1 1102615 4728 0.097 0.250 0.653 +SRR10698388 CLFT166 JAQIHF010000008.1 1010461 4487 0.108 0.217 0.676 +SRR10698388 CLFT166 JAQIHF010000009.1 1001226 4172 0.091 0.056 0.853 +SRR10698388 CLFT166 JAQIHF010000010.1 975555 3714 0.219 0.121 0.659 +SRR10698388 CLFT166 JAQIHF010000011.1 956964 3587 0.269 0.086 0.645 +SRR10698388 CLFT166 JAQIHF010000012.1 927035 4441 0.257 0.122 0.620 +SRR10698388 CLFT166 JAQIHF010000013.1 794278 3116 0.149 0.090 0.761 +SRR10698388 CLFT166 JAQIHF010000014.1 691023 2960 0.376 0.097 0.527 +SRR10698389 CLFT165 JAQIHF010000001.1 4271105 19887 0.543 0.341 0.116 +SRR10698389 CLFT165 JAQIHF010000002.1 2429103 10380 0.644 0.237 0.119 +SRR10698389 CLFT165 JAQIHF010000003.1 1821279 10798 0.791 0.195 0.014 +SRR10698389 CLFT165 JAQIHF010000004.1 1449457 6985 0.538 0.430 0.032 +SRR10698389 CLFT165 JAQIHF010000005.1 1292353 6641 0.691 0.234 0.075 +SRR10698389 CLFT165 JAQIHF010000006.1 1130921 8356 0.836 0.116 0.049 +SRR10698389 CLFT165 JAQIHF010000007.1 1102615 6696 0.399 0.527 0.073 +SRR10698389 CLFT165 JAQIHF010000008.1 1010461 4101 0.809 0.133 0.058 +SRR10698389 CLFT165 JAQIHF010000009.1 1001226 4400 0.659 0.105 0.236 +SRR10698389 CLFT165 JAQIHF010000010.1 975555 4016 0.585 0.335 0.080 +SRR10698389 CLFT165 JAQIHF010000011.1 956964 4541 0.707 0.175 0.118 +SRR10698389 CLFT165 JAQIHF010000012.1 927035 5445 0.718 0.075 0.207 +SRR10698389 CLFT165 JAQIHF010000013.1 794278 3076 0.572 0.249 0.179 +SRR10698389 CLFT165 JAQIHF010000014.1 691023 4500 0.636 0.276 0.088 +SRR10698391 CLFT160 JAQIHF010000001.1 4271105 20977 0.245 0.693 0.062 +SRR10698391 CLFT160 JAQIHF010000002.1 2429103 10293 0.349 0.528 0.123 +SRR10698391 CLFT160 JAQIHF010000003.1 1821279 10909 0.645 0.280 0.075 +SRR10698391 CLFT160 JAQIHF010000004.1 1449457 6899 0.333 0.607 0.060 +SRR10698391 CLFT160 JAQIHF010000005.1 1292353 5525 0.312 0.477 0.210 +SRR10698391 CLFT160 JAQIHF010000006.1 1130921 9444 0.633 0.363 0.004 +SRR10698391 CLFT160 JAQIHF010000007.1 1102615 6222 0.389 0.511 0.100 +SRR10698391 CLFT160 JAQIHF010000008.1 1010461 5233 0.338 0.520 0.142 +SRR10698391 CLFT160 JAQIHF010000009.1 1001226 4796 0.227 0.726 0.048 +SRR10698391 CLFT160 JAQIHF010000010.1 975555 4753 0.277 0.162 0.560 +SRR10698391 CLFT160 JAQIHF010000011.1 956964 4398 0.411 0.451 0.138 +SRR10698391 CLFT160 JAQIHF010000012.1 927035 6254 0.417 0.450 0.133 +SRR10698391 CLFT160 JAQIHF010000013.1 794278 3437 0.312 0.501 0.188 +SRR10698391 CLFT160 JAQIHF010000014.1 691023 3401 0.418 0.077 0.505 +SRR10698394 CLFT156 JAQIHF010000001.1 4271105 18789 0.143 0.139 0.718 +SRR10698394 CLFT156 JAQIHF010000002.1 2429103 8657 0.174 0.138 0.688 +SRR10698394 CLFT156 JAQIHF010000003.1 1821279 7802 0.173 0.158 0.670 +SRR10698394 CLFT156 JAQIHF010000004.1 1449457 5772 0.099 0.147 0.755 +SRR10698394 CLFT156 JAQIHF010000005.1 1292353 4870 0.201 0.112 0.687 +SRR10698394 CLFT156 JAQIHF010000006.1 1130921 5693 0.215 0.191 0.594 +SRR10698394 CLFT156 JAQIHF010000007.1 1102615 5440 0.147 0.187 0.666 +SRR10698394 CLFT156 JAQIHF010000008.1 1010461 4686 0.176 0.074 0.750 +SRR10698394 CLFT156 JAQIHF010000009.1 1001226 4130 0.087 0.054 0.858 +SRR10698394 CLFT156 JAQIHF010000010.1 975555 4032 0.134 0.093 0.774 +SRR10698394 CLFT156 JAQIHF010000011.1 956964 3840 0.178 0.283 0.539 +SRR10698394 CLFT156 JAQIHF010000012.1 927035 4765 0.176 0.239 0.584 +SRR10698394 CLFT156 JAQIHF010000013.1 794278 3009 0.072 0.286 0.642 +SRR10698394 CLFT156 JAQIHF010000014.1 691023 3193 0.197 0.285 0.518 +SRR10698402 CLFT130 JAQIHF010000001.1 4271105 17211 0.181 0.116 0.703 +SRR10698402 CLFT130 JAQIHF010000002.1 2429103 8801 0.176 0.207 0.618 +SRR10698402 CLFT130 JAQIHF010000003.1 1821279 7405 0.143 0.177 0.680 +SRR10698402 CLFT130 JAQIHF010000004.1 1449457 5201 0.121 0.162 0.718 +SRR10698402 CLFT130 JAQIHF010000005.1 1292353 5239 0.172 0.195 0.634 +SRR10698402 CLFT130 JAQIHF010000006.1 1130921 6095 0.227 0.190 0.583 +SRR10698402 CLFT130 JAQIHF010000007.1 1102615 4693 0.123 0.247 0.630 +SRR10698402 CLFT130 JAQIHF010000008.1 1010461 4254 0.127 0.094 0.779 +SRR10698402 CLFT130 JAQIHF010000009.1 1001226 4176 0.102 0.063 0.835 +SRR10698402 CLFT130 JAQIHF010000010.1 975555 4098 0.118 0.235 0.647 +SRR10698402 CLFT130 JAQIHF010000011.1 956964 3583 0.257 0.146 0.597 +SRR10698402 CLFT130 JAQIHF010000012.1 927035 4680 0.212 0.245 0.543 +SRR10698402 CLFT130 JAQIHF010000013.1 794278 2764 0.163 0.095 0.742 +SRR10698402 CLFT130 JAQIHF010000014.1 691023 3317 0.242 0.190 0.569 +SRR10698403 CLFT044 JAQIHF010000001.1 4271105 21765 0.929 0.068 0.003 +SRR10698403 CLFT044 JAQIHF010000002.1 2429103 10888 0.790 0.205 0.005 +SRR10698403 CLFT044 JAQIHF010000003.1 1821279 11405 0.976 0.023 0.001 +SRR10698403 CLFT044 JAQIHF010000004.1 1449457 7204 0.990 0.008 0.002 +SRR10698403 CLFT044 JAQIHF010000005.1 1292353 8675 0.913 0.086 0.002 +SRR10698403 CLFT044 JAQIHF010000006.1 1130921 9653 0.891 0.107 0.002 +SRR10698403 CLFT044 JAQIHF010000007.1 1102615 6839 0.872 0.121 0.007 +SRR10698403 CLFT044 JAQIHF010000008.1 1010461 5749 0.767 0.222 0.011 +SRR10698403 CLFT044 JAQIHF010000009.1 1001226 5257 0.990 0.009 0.001 +SRR10698403 CLFT044 JAQIHF010000010.1 975555 5869 0.892 0.099 0.008 +SRR10698403 CLFT044 JAQIHF010000011.1 956964 4768 0.733 0.253 0.015 +SRR10698403 CLFT044 JAQIHF010000012.1 927035 7142 0.827 0.163 0.010 +SRR10698403 CLFT044 JAQIHF010000013.1 794278 3467 0.686 0.300 0.015 +SRR10698403 CLFT044 JAQIHF010000014.1 691023 4698 0.919 0.077 0.003 +SRR10698407 CLFT120 JAQIHF010000001.1 4271105 17440 0.159 0.064 0.777 +SRR10698407 CLFT120 JAQIHF010000002.1 2429103 8956 0.162 0.242 0.596 +SRR10698407 CLFT120 JAQIHF010000003.1 1821279 8137 0.201 0.130 0.668 +SRR10698407 CLFT120 JAQIHF010000004.1 1449457 5866 0.120 0.164 0.717 +SRR10698407 CLFT120 JAQIHF010000005.1 1292353 5038 0.176 0.191 0.633 +SRR10698407 CLFT120 JAQIHF010000006.1 1130921 5858 0.278 0.110 0.612 +SRR10698407 CLFT120 JAQIHF010000007.1 1102615 5140 0.120 0.238 0.642 +SRR10698407 CLFT120 JAQIHF010000008.1 1010461 4701 0.123 0.073 0.804 +SRR10698407 CLFT120 JAQIHF010000009.1 1001226 4127 0.100 0.064 0.835 +SRR10698407 CLFT120 JAQIHF010000010.1 975555 3864 0.128 0.140 0.733 +SRR10698407 CLFT120 JAQIHF010000011.1 956964 3671 0.205 0.273 0.522 +SRR10698407 CLFT120 JAQIHF010000012.1 927035 4949 0.197 0.271 0.532 +SRR10698407 CLFT120 JAQIHF010000013.1 794278 2829 0.080 0.281 0.639 +SRR10698407 CLFT120 JAQIHF010000014.1 691023 3387 0.232 0.200 0.568 +SRR10698416 CLFT088 JAQIHF010000001.1 4271105 18298 0.115 0.184 0.700 +SRR10698416 CLFT088 JAQIHF010000002.1 2429103 9228 0.161 0.268 0.571 +SRR10698416 CLFT088 JAQIHF010000003.1 1821279 8335 0.219 0.138 0.643 +SRR10698416 CLFT088 JAQIHF010000004.1 1449457 5657 0.139 0.161 0.700 +SRR10698416 CLFT088 JAQIHF010000005.1 1292353 5710 0.195 0.188 0.618 +SRR10698416 CLFT088 JAQIHF010000006.1 1130921 6001 0.305 0.116 0.579 +SRR10698416 CLFT088 JAQIHF010000007.1 1102615 5097 0.137 0.238 0.625 +SRR10698416 CLFT088 JAQIHF010000008.1 1010461 4724 0.128 0.213 0.659 +SRR10698416 CLFT088 JAQIHF010000009.1 1001226 4379 0.112 0.066 0.822 +SRR10698416 CLFT088 JAQIHF010000010.1 975555 4359 0.161 0.248 0.591 +SRR10698416 CLFT088 JAQIHF010000011.1 956964 3975 0.268 0.149 0.583 +SRR10698416 CLFT088 JAQIHF010000012.1 927035 5267 0.223 0.235 0.542 +SRR10698416 CLFT088 JAQIHF010000013.1 794278 2865 0.077 0.231 0.691 +SRR10698416 CLFT088 JAQIHF010000014.1 691023 3608 0.363 0.078 0.560 +SRR10698425 CLFT039 JAQIHF010000001.1 4271105 20911 0.322 0.542 0.135 +SRR10698425 CLFT039 JAQIHF010000002.1 2429103 9918 0.294 0.370 0.336 +SRR10698425 CLFT039 JAQIHF010000003.1 1821279 10598 0.460 0.511 0.029 +SRR10698425 CLFT039 JAQIHF010000004.1 1449457 6312 0.378 0.457 0.165 +SRR10698425 CLFT039 JAQIHF010000005.1 1292353 6432 0.405 0.428 0.167 +SRR10698425 CLFT039 JAQIHF010000006.1 1130921 8581 0.533 0.357 0.110 +SRR10698425 CLFT039 JAQIHF010000007.1 1102615 6383 0.373 0.529 0.098 +SRR10698425 CLFT039 JAQIHF010000008.1 1010461 5408 0.340 0.520 0.141 +SRR10698425 CLFT039 JAQIHF010000009.1 1001226 4478 0.158 0.528 0.314 +SRR10698425 CLFT039 JAQIHF010000010.1 975555 5482 0.354 0.384 0.262 +SRR10698425 CLFT039 JAQIHF010000011.1 956964 4382 0.384 0.469 0.148 +SRR10698425 CLFT039 JAQIHF010000012.1 927035 6133 0.425 0.437 0.138 +SRR10698425 CLFT039 JAQIHF010000013.1 794278 3326 0.260 0.558 0.182 +SRR10698425 CLFT039 JAQIHF010000014.1 691023 3688 0.495 0.407 0.098 diff --git a/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/site_genotype_summary.tsv b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/site_genotype_summary.tsv new file mode 100644 index 00000000..dbc3eeb1 --- /dev/null +++ b/datasets/reads/sketch_store/reports/batrachochytrium_dendrobatidis/coverage_heterozygosity/tables/site_genotype_summary.tsv @@ -0,0 +1,10 @@ +run isolate class median_depth_full sites share_clft share_het share_jel +SRR10698388 CLFT166 JEL-type 25.2 94652 0.188 0.150 0.662 +SRR10698389 CLFT165 CLFT-type 23.0 119222 0.670 0.244 0.086 +SRR10698391 CLFT160 HET-rich 26.4 122521 0.414 0.468 0.118 +SRR10698394 CLFT156 JEL-type 28.8 98994 0.186 0.164 0.650 +SRR10698402 CLFT130 JEL-type 13.4 95915 0.200 0.169 0.631 +SRR10698403 CLFT044 CLFT-type 39.1 136328 0.890 0.105 0.005 +SRR10698407 CLFT120 JEL-type 15.3 98659 0.194 0.166 0.639 +SRR10698416 CLFT088 JEL-type 15.9 104177 0.209 0.189 0.602 +SRR10698425 CLFT039 HET-rich 15.1 122355 0.408 0.440 0.152 diff --git a/scripts/bd_aneuploidy.py b/scripts/bd_aneuploidy.py new file mode 100644 index 00000000..333fb9e8 --- /dev/null +++ b/scripts/bd_aneuploidy.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +"""Isolate-specific chromosome depth changes (possible aneuploidy or copy-number change) in Bd, from bd_depth_by_seq_.tsv. + +Input --depth-by-seq bd_depth_by_seq_.tsv (run, seq, length, depth_ratio, het_per_mb; ratio = sequence median depth / genome median) + --classes tables/isolate_classes.tsv (run, isolate, class, ...; class from the parent-of-origin analysis) + --summary bd_isolate_summary_.tsv (median_depth per run) +Method : sequences of at least --min-len bp. For each class with at least --min-class isolates, the median ratio of a sequence over + that class is the reference level (this removes reference-specific offsets, for example a lineage that maps worse on one + chromosome). Normalised ratio = ratio / class median. An isolate-sequence is flagged when the normalised ratio is outside + 1 +/- --delta. Only isolates with median depth >= --min-depth are flagged (low depth is noisy). Expected values for one extra + or one missing copy in a diploid are 1.5 and 0.5; values near 1.33/0.67 fit a 3n or 1n state of a 4n/2n genome. +With --fallback-class the isolates of small classes are compared with the median of that class (labelled with a star). +Output : aneuploidy_flags.tsv (run, isolate, class, seq, length, ratio, class_median, normalised, het_per_mb, median_depth) and + aneuploidy_by_sequence.tsv (seq, length, per class median ratio and number of flagged isolates). +Limit : depth ratio is relative to the genome median, so a change of one chromosome shifts the others slightly; a whole-genome ploidy + change is invisible here. Repeat-rich or organellar sequences (ratio far from 1 in every isolate) are excluded by --min-len and + by --max-class-median-dev. +""" +import argparse +import collections +import csv +import statistics + + +def normalise(ratios_by_class): + """{class: {run: ratio}} -> ({class: median}, {(class, run): ratio / median}).""" + med, norm = {}, {} + for c, d in ratios_by_class.items(): + m = statistics.median(d.values()) + med[c] = m + for run, r in d.items(): + norm[(c, run)] = r / m if m else float("nan") + return med, norm + + +def flag(norm_value, delta): + return abs(norm_value - 1.0) >= delta + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--depth-by-seq", required=True) + ap.add_argument("--classes", required=True) + ap.add_argument("--summary", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--min-len", type=int, default=500000) + ap.add_argument("--delta", type=float, default=0.25) + ap.add_argument("--min-class", type=int, default=10) + ap.add_argument("--min-depth", type=float, default=20.0) + ap.add_argument("--max-class-median-dev", type=float, default=0.5) + ap.add_argument("--fallback-class", help="class whose median is the reference level for isolates of classes with fewer than --min-class isolates (for example JEL-type for the two HET-rich isolates); such flags are labelled with the class name plus '*'") + a = ap.parse_args() + cls = {r["run"]: r for r in csv.DictReader(open(a.classes), delimiter="\t")} + depth = {r["run"]: float(r["median_depth"]) for r in csv.DictReader(open(a.summary), delimiter="\t")} + rows = [r for r in csv.DictReader(open(a.depth_by_seq), delimiter="\t") if int(r["length"]) >= a.min_len and r["run"] in cls] + ncls = collections.Counter(cls[r["run"]]["class"] for r in {x["run"]: x for x in rows}.values()) + usable = {c for c, n in ncls.items() if n >= a.min_class} + seqs = sorted({r["seq"] for r in rows}) + flags, bysec = [], [] + for s in seqs: + per = collections.defaultdict(dict) + info = {} + for r in rows: + if r["seq"] == s and cls[r["run"]]["class"] in usable: + per[cls[r["run"]]["class"]][r["run"]] = float(r["depth_ratio"]) + info[r["run"]] = (r["length"], r["het_per_mb"]) + med, norm = normalise(per) + if a.fallback_class and a.fallback_class in med: + small = collections.defaultdict(dict) + for r in rows: + c = cls[r["run"]]["class"] + if r["seq"] == s and c not in usable: + small[c + "*"][r["run"]] = float(r["depth_ratio"]) + info[r["run"]] = (r["length"], r["het_per_mb"]) + for c, d in small.items(): + med[c] = med[a.fallback_class] + for run, v in d.items(): + norm[(c, run)] = v / med[a.fallback_class] + per[c] = d + nflag = collections.Counter() + for (c, run), v in norm.items(): + if abs(med[c] - 1.0) > a.max_class_median_dev: + continue + if flag(v, a.delta) and depth.get(run, 0) >= a.min_depth: + nflag[c] += 1 + flags.append((run, cls[run]["isolate"], c, s, info[run][0], round(per[c][run], 3), round(med[c], 3), round(v, 3), + info[run][1], depth[run])) + bysec.append((s, rows[[r["seq"] for r in rows].index(s)]["length"], + ";".join(f"{c}:{med[c]:.2f}:{nflag[c]}" for c in sorted(med)))) + with open(a.out + "/aneuploidy_flags.tsv", "w") as fo: + fo.write("run\tisolate\tclass\tseq\tlength\tratio\tclass_median\tnormalised\thet_per_mb\tmedian_depth\n") + for f in sorted(flags, key=lambda x: (x[0], x[3])): + fo.write("\t".join(map(str, f)) + "\n") + with open(a.out + "/aneuploidy_by_sequence.tsv", "w") as fo: + fo.write("seq\tlength\tclass:median_ratio:n_flagged\n") + for b in bysec: + fo.write("\t".join(b) + "\n") + print(len(flags), "isolate-sequence flags;", len({f[0] for f in flags}), "isolates; classes used:", sorted(usable)) + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_aneuploidy_af.py b/scripts/bd_aneuploidy_af.py new file mode 100644 index 00000000..c5f015dd --- /dev/null +++ b/scripts/bd_aneuploidy_af.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +"""Allele balance on flagged chromosomes: does a depth gain look like an extra chromosome copy? + +For each flag of bd_aneuploidy.py (aneuploidy_flags.tsv) with a normalised ratio >= --gain or <= --loss, take the heterozygous SNPs of +that isolate (bcftools table per_run_/.snps.tsv.gz; biallelic, DP >= 10 and within 0.5x to 2x of the isolate median depth, as in +bd_summarize.py) on the flagged sequence and on all other sequences of 500 kb or more, fold the alternative-allele fraction to the minor +allele (<= 0.5), and report the share of het sites (minor fraction 0.15 to 0.5) in three bins: near 1/3 (0.27 to 0.40), near 1/2 (0.43 to 0.50) +and other. A trisomic chromosome of a diploid should move sites from 1/2 to 1/3; a monosomic one removes het sites (het per Mb falls). +With --genomewide the per-isolate shares over all sequences of at least --min-len and a baseline label (third-dominated if the 1/3 share exceeds the +1/2 share by 0.1, half-dominated in the opposite case, mixed otherwise) are written too: a first look at the baseline ploidy state of each isolate. +Output: aneuploidy_af.tsv (run, isolate, seq, normalised, het_sites_flagged, share_third_flagged, share_half_flagged, het_sites_rest, +share_third_rest, share_half_rest, het_per_mb_flagged, het_per_mb_rest). +Limit: low-depth isolates give wide allele-fraction noise (a 20x site has binomial sd of about 0.11), so a shift from 0.5 to 0.33 needs many sites. +""" +import argparse +import csv +import gzip +import statistics +import collections + + +def fold(af): + return min(af, 1 - af) + + +def shares(mafs): + """(n, share near 1/3, share near 1/2) among minor-allele fractions of het sites (0.15 to 0.5).""" + het = [m for m in mafs if 0.15 <= m <= 0.5] + if not het: + return 0, float("nan"), float("nan") + third = sum(0.27 <= m <= 0.40 for m in het) / len(het) + half = sum(0.43 <= m <= 0.50 for m in het) / len(het) + return len(het), third, half + + +def read_snps(path, lo, hi): + out = collections.defaultdict(list) + with gzip.open(path, "rt") as fh: + for line in fh: + f = line.rstrip("\n").split("\t") + if len(f) < 7 or "," in f[3]: + continue + try: + dp = int(f[5]); ad = [int(x) for x in f[6].split(",")] + except ValueError: + continue + if len(ad) == 2 and sum(ad) and dp >= 10 and lo <= dp <= hi: + out[f[0]].append(fold(ad[1] / sum(ad))) + return out + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--flags", required=True) + ap.add_argument("--classes", help="isolate_classes.tsv (only for --genomewide labels)") + ap.add_argument("--base", required=True) + ap.add_argument("--ref", default="JEL423") + ap.add_argument("--lengths", required=True, help="bd_depth_by_seq_.tsv (for sequence lengths)") + ap.add_argument("--summary", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--gain", type=float, default=1.3) + ap.add_argument("--loss", type=float, default=0.7) + ap.add_argument("--min-len", type=int, default=500000) + ap.add_argument("--genomewide", help="also write per-isolate genome-wide allele-balance shares (all isolates with a snp table) to this TSV") + a = ap.parse_args() + L = {r["seq"]: int(r["length"]) for r in csv.DictReader(open(a.lengths), delimiter="\t")} + depth = {r["run"]: float(r["median_depth"]) for r in csv.DictReader(open(a.summary), delimiter="\t")} + big = {s for s, l in L.items() if l >= a.min_len} + rows = [] + for f in csv.DictReader(open(a.flags), delimiter="\t"): + nv = float(f["normalised"]) + if not (nv >= a.gain or nv <= a.loss): + continue + d = depth[f["run"]] + snps = read_snps(f"{a.base}/per_run_{a.ref}/{f['run']}.snps.tsv.gz", 0.5 * d, 2 * d) + fl = snps.get(f["seq"], []) + rest = [m for s, v in snps.items() if s in big and s != f["seq"] for m in v] + n1, t1, h1 = shares(fl) + n2, t2, h2 = shares(rest) + lenf = L[f["seq"]] / 1e6 + lenr = sum(L[s] for s in big if s != f["seq"]) / 1e6 + rows.append((f["run"], f["isolate"], f["seq"], f["normalised"], n1, round(t1, 3), round(h1, 3), n2, round(t2, 3), round(h2, 3), + round(n1 / lenf, 1), round(n2 / lenr, 1))) + if a.genomewide: + import os + cl = {r["run"]: r for r in csv.DictReader(open(a.classes), delimiter="\t")} if a.classes else {} + with open(a.genomewide, "w") as fg: + fg.write("run\tisolate\tclass\tmedian_depth\the_sites\tshare_third\tshare_half\tbaseline\n") + for run, d in depth.items(): + path = f"{a.base}/per_run_{a.ref}/{run}.snps.tsv.gz" + if not os.path.exists(path): + continue + snps = read_snps(path, 0.5 * d, 2 * d) + allm = [m for sq, v in snps.items() if sq in big for m in v] + n, t, h = shares(allm) + base = "NA" if n < 500 else ("third-dominated" if t > h + 0.1 else "half-dominated" if h > t + 0.1 else "mixed") + fg.write(f"{run}\t{cl.get(run, {}).get('isolate', '')}\t{cl.get(run, {}).get('class', '')}\t{d}\t{n}\t{round(t, 3)}\t{round(h, 3)}\t{base}\n") + with open(a.out, "w") as fo: + fo.write("run\tisolate\tseq\tnormalised\the_flagged\tshare_third_flagged\tshare_half_flagged\the_rest\tshare_third_rest\tshare_half_rest\the_per_mb_flagged\the_per_mb_rest\n") + for r in sorted(rows, key=lambda r: -abs(float(r[3]) - 1)): + fo.write("\t".join(map(str, r)) + "\n") + print(open(a.out).read()) + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_coverage_isolates.slurm b/scripts/bd_coverage_isolates.slurm new file mode 100644 index 00000000..2e266d79 --- /dev/null +++ b/scripts/bd_coverage_isolates.slurm @@ -0,0 +1,38 @@ +#!/usr/bin/bash +#SBATCH --job-name=bd-cov +#SBATCH --partition=epyc +#SBATCH --cpus-per-task=8 +#SBATCH --mem=24gb +#SBATCH --time=4:00:00 +#SBATCH --output=/bigdata/stajichlab/jstajich/projects/MATPredict/logs/bdcov_%A_%a.log +# Align Batrachochytrium WGS runs to a reference, then depth windows and SNP allele depths. +# Env: SRC, BASE (results/2026-11-13_bd_coverage), REFNAME (JEL423 or CLFT044; fasta in $BASE/ref), CHUNK (file: one run accession per line). +# Array task N reads $BASE/chunks/chunk_N.txt when CHUNK is unset. +set -uo pipefail +: "${SRC:?}" "${BASE:?}" +export PATH=/bigdata/stajichlab/jstajich/projects/MATPredict/.pixi/envs/default/bin:$PATH +module load sratoolkit/3.2.0 bwa-mem2/2.2.1 samtools/1.22.1 bcftools/1.22 mosdepth/0.3.12 +CH="${CHUNK:-$BASE/chunks/chunk_${SLURM_ARRAY_TASK_ID}.txt}" +REFNAME="${REFNAME:-JEL423}"; REF="$BASE/ref/$REFNAME.fa" +OUT="$BASE/per_run_$REFNAME"; mkdir -p "$OUT" +W="${SCRATCH:?}/bdcov"; mkdir -p "$W" +while read -r run; do + [[ -z "$run" ]] && continue + [[ -s "$OUT/$run.snps.tsv.gz" ]] && continue + [[ -s "$BASE/sra/$run/$run.sra" ]] || { echo "NOT DOWNLOADED $run"; continue; } + exp=$(awk -F"\t" -v r="$run" '$2==r{print $7}' "$BASE/bd_runs.tsv") + fasterq-dump "$BASE/sra/$run/$run.sra" -e 8 -O "$W" --temp "$W" --split-files -f > "$OUT/$run.fasterq.log" 2>&1 || { echo "FAIL fasterq $run"; continue; } + n1=$(( $(wc -l < "$W/${run}_1.fastq") / 4 )); n2=$(( $(wc -l < "$W/${run}_2.fastq") / 4 )) + if [[ "$n1" != "$exp" || "$n2" != "$exp" ]]; then echo "READ COUNT MISMATCH $run mate1=$n1 mate2=$n2 ena=$exp"; rm -f "$W/${run}"_*.fastq; continue; fi + bwa-mem2 mem -t 8 -R "@RG\tID:$run\tSM:$run" "$REF" "$W/${run}_1.fastq" "$W/${run}_2.fastq" 2> "$OUT/$run.bwa.log" \ + | samtools fixmate -m -@ 4 - - | samtools sort -@ 4 -T "$W/st_$run" - | samtools markdup -r -@ 4 - "$W/$run.bam" + samtools index "$W/$run.bam" + mosdepth -n -t 4 --by 10000 --mapq 20 "$OUT/$run" "$W/$run.bam" + samtools flagstat "$W/$run.bam" > "$OUT/$run.flagstat.txt" + bcftools mpileup -f "$REF" -q 20 -Q 20 -a FORMAT/AD,FORMAT/DP -d 1000 -Ou "$W/$run.bam" \ + | bcftools call -mv -V indels -Ou | bcftools view -i 'QUAL>=30' -Ou \ + | bcftools query -f '%CHROM\t%POS\t%REF\t%ALT\t%QUAL\t[%DP\t%AD]\n' | gzip > "$OUT/$run.snps.tsv.gz" + echo "$run reads=$n1 done" + rm -f "$W/${run}"_*.fastq "$W/$run.bam"* +done < "$CH" +echo done diff --git a/scripts/bd_hetrich_check.py b/scripts/bd_hetrich_check.py new file mode 100644 index 00000000..310bf1b2 --- /dev/null +++ b/scripts/bd_hetrich_check.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +"""Hybrid versus aneuploid pattern for chosen isolates: per-chromosome depth, allele balance and parent-of-origin window classes. + +Read-only analysis. For each --run: + JEL423 reference : per sequence (>= --min-len): depth ratio (bd_depth_by_seq_JEL423.tsv), het SNPs per Mb and the share of het sites near 1/3 and + near 1/2 (minor allele fraction), from per_run_JEL423/.snps.tsv.gz + CLFT044 reference: per sequence (>= --min-len): share of 50 kb windows of the parent-of-origin analysis in each class (CLFT, HET, JELHOM) + (parent_origin/parent_origin_windows.tsv.gz) +A first-generation hybrid should show HET windows on every sequence and an even allele balance; an aneuploid isolate shows local departures of +depth and of the 1/3 share. Isolates of one lineage should show CLFT or JELHOM windows throughout. +Output (--out): hetrich_by_sequence.tsv +""" +import argparse +import collections +import csv +import gzip +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from bd_aneuploidy_af import read_snps, shares # noqa: E402 + + +def window_classes(path, run, lengths, min_len): + """{seq: Counter(class)} for one run from parent_origin_windows.tsv.gz, sequences of >= min_len bp.""" + out = collections.defaultdict(collections.Counter) + with gzip.open(path, "rt") as fh: + next(fh) + for line in fh: + f = line.rstrip("\n").split("\t") + if f[0] == run and lengths.get(f[1], 0) >= min_len: + out[f[1]][f[7]] += 1 + return out + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--base", required=True) + ap.add_argument("--run", action="append", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--min-len", type=int, default=500000) + a = ap.parse_args() + summ = {r["run"]: r for r in csv.DictReader(open(f"{a.base}/bd_isolate_summary_JEL423.tsv"), delimiter="\t")} + dj = list(csv.DictReader(open(f"{a.base}/bd_depth_by_seq_JEL423.tsv"), delimiter="\t")) + dc = list(csv.DictReader(open(f"{a.base}/bd_depth_by_seq_CLFT044.tsv"), delimiter="\t")) + lj = {r["seq"]: int(r["length"]) for r in dj} + lc = {r["seq"]: int(r["length"]) for r in dc} + with open(a.out, "w") as fo: + fo.write("run\treference\tseq\tlength\tdepth_ratio\the_per_mb\tshare_third\tshare_half\twindows\tshare_CLFT\tshare_HET\tshare_JELHOM\n") + for run in a.run: + d = float(summ[run]["median_depth"]) + snps = read_snps(f"{a.base}/per_run_JEL423/{run}.snps.tsv.gz", 0.5 * d, 2 * d) + for r in dj: + if r["run"] == run and lj[r["seq"]] >= a.min_len: + n, t, h = shares(snps.get(r["seq"], [])) + fo.write(f"{run}\tJEL423\t{r['seq']}\t{r['length']}\t{r['depth_ratio']}\t{n / (int(r['length']) / 1e6):.1f}\t{t:.3f}\t{h:.3f}\t\t\t\t\n") + wc = window_classes(f"{a.base}/parent_origin/parent_origin_windows.tsv.gz", run, lc, a.min_len) + for r in dc: + if r["run"] == run and r["seq"] in wc: + c = wc[r["seq"]] + tot = sum(c.values()) + fo.write(f"{run}\tCLFT044\t{r['seq']}\t{r['length']}\t{r['depth_ratio']}\t\t\t\t{tot}\t{c['CLFT'] / tot:.3f}\t{c['HET'] / tot:.3f}\t{c['JELHOM'] / tot:.3f}\n") + print(open(a.out).read()) + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_idiomorph_scan.py b/scripts/bd_idiomorph_scan.py new file mode 100644 index 00000000..e91174ac --- /dev/null +++ b/scripts/bd_idiomorph_scan.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python3 +"""Cross-isolate depth scan for presence/absence regions that could hold a mating-type idiomorph (Bd). + +Idea (not validated for Bd): in a diploid population with two idiomorphs, a window inside the idiomorph shows +depth ratio near 1 in isolates with two copies of the reference idiomorph, near 0.5 in hemizygous isolates (one +copy of the reference idiomorph, one copy of the other) and near 0 in isolates with none. Hemizygous windows should +carry about no het SNPs because only one copy aligns. + +Input : --base results folder with bd_windows_.tsv.gz (10 kb windows: run seq start depth_ratio snps het), + bd_isolate_summary_.tsv (median_depth), bd_runs.tsv; --paf JEL423_vs_CLFT044.paf.gz; --gff3 of the reference. +Steps : + 1. keep isolates with median depth >= --min-depth. + 2. normalise each window ratio by the median ratio of its sequence (sequences >= 200 kb), which removes whole- + sequence copy-number changes. + 3. class per window and isolate: LOW < 0.25, HALF 0.35-0.65, FULL 0.8-1.25, OTHER otherwise. + 4. candidate window: >= --min-full isolates FULL and >= --min-var isolates LOW or HALF. + Adjacent candidate windows on one sequence merge into a region; regions >= --min-len bp are kept. + 5. null: each isolate's classes on each sequence are rotated by a random offset (keeps run lengths, breaks the + co-location across isolates); the region count is recomputed --perms times. + 6. region annotation: share of the region covered by the other assembly in the PAF, counts of LOW/HALF/FULL by + isolate group, median het SNPs per window in HALF and FULL isolates, and genes from the GFF3 (product / Note + keywords HMG, homeodomain, mating, sex, pheromone). +Output : idiomorph_regions_.tsv, idiomorph_genes_.tsv, idiomorph_null_.tsv (in --out). +Limits : a lineage-private deletion also gives LOW in one lineage and FULL in the other; HALF isolates and the group +counts are given to tell them apart. Noise at 10-20x depth is why isolates below --min-depth are dropped. +""" +import argparse +import bisect +import collections +import csv +import gzip +import os +import random +import re +import statistics + +LOW, HALF, FULL, OTHER = 0, 1, 2, 3 +KEYWORDS = re.compile(r"HMG|homeo|mating|sex|pheromone|MAT1|SXI|STE|alpha", re.I) + + +def classify(r): + return LOW if r < .25 else HALF if .35 <= r <= .65 else FULL if .8 <= r <= 1.25 else OTHER + + +def load_windows(path, keep): + """-> {run: {seq: [(start, norm_ratio, het)]}}; norm by sequence median for sequences >= 200 kb.""" + raw = collections.defaultdict(lambda: collections.defaultdict(list)) + with gzip.open(path, "rt") as fh: + next(fh) + for line in fh: + run, seq, start, r, snps, het = line.rstrip("\n").split("\t") + if run in keep: + raw[run][seq].append((int(start), float(r), int(het))) + out = {} + for run, d in raw.items(): + out[run] = {} + for seq, rows in d.items(): + rows.sort() + med = statistics.median(x[1] for x in rows) if len(rows) >= 20 else 1.0 + med = med if med > 0 else 1.0 + out[run][seq] = [(s, r / med, h) for s, r, h in rows] + return out + + +def candidate_flags(classes, min_full, min_var): + """classes: list over isolates of per-window class lists (same length) -> list of bool per window.""" + n = len(classes[0]) + flags = [] + for i in range(n): + full = var = 0 + for c in classes: + v = c[i] + full += v == FULL + var += v in (LOW, HALF) + flags.append(full >= min_full and var >= min_var) + return flags + + +def merge_regions(flags, starts, window, min_windows): + regs, i, n = [], 0, len(flags) + while i < n: + if flags[i]: + j = i + while j + 1 < n and flags[j + 1] and starts[j + 1] == starts[j] + window: + j += 1 + if j - i + 1 >= min_windows: + regs.append((starts[i], starts[j] + window)) + i = j + 1 + else: + i += 1 + return regs + + +def paf_intervals(path, side, min_block): + """Intervals covered by primary alignments. side 'target' (CLFT044) or 'query' (JEL423).""" + iv = collections.defaultdict(list) + with gzip.open(path, "rt") as fh: + for line in fh: + f = line.split("\t") + if len(f) < 12 or int(f[10]) < min_block: + continue + if side == "target": + iv[f[5]].append((int(f[7]), int(f[8]))) + else: + iv[f[0]].append((int(f[2]), int(f[3]))) + out = {} + for k, v in iv.items(): + v.sort() + merged = [] + for s, e in v: + if merged and s <= merged[-1][1]: + merged[-1][1] = max(merged[-1][1], e) + else: + merged.append([s, e]) + out[k] = merged + return out + + +def covered(iv, seq, s, e): + tot = 0 + for a, b in iv.get(seq, []): + if b <= s: + continue + if a >= e: + break + tot += min(b, e) - max(a, s) + return tot / (e - s) + + +def read_genes(gff): + genes = collections.defaultdict(list) + op = gzip.open if gff.endswith(".gz") else open + with op(gff, "rt") as fh: + for line in fh: + if line.startswith("#"): + continue + f = line.rstrip("\n").split("\t") + if len(f) < 9 or f[2] != "gene": + continue + at = dict(x.split("=", 1) for x in f[8].split(";") if "=" in x) + text = " ".join(at.get(k, "") for k in ("product", "Note", "Name", "note")) + genes[f[0]].append((int(f[3]), int(f[4]), at.get("ID", ""), text)) + for v in genes.values(): + v.sort() + return genes + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--base", required=True) + ap.add_argument("--ref", required=True, choices=["CLFT044", "JEL423"]) + ap.add_argument("--paf", required=True) + ap.add_argument("--gff3", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--groups", help="TSV runclass (isolate_classes.tsv) for group counts") + ap.add_argument("--window", type=int, default=10000) + ap.add_argument("--min-depth", type=float, default=20.0) + ap.add_argument("--min-full", type=int, default=5) + ap.add_argument("--min-var", type=int, default=3) + ap.add_argument("--min-len", type=int, default=20000) + ap.add_argument("--perms", type=int, default=200) + ap.add_argument("--seed", type=int, default=1) + a = ap.parse_args() + os.makedirs(a.out, exist_ok=True) + summ = {r["run"]: r for r in csv.DictReader(open(f"{a.base}/bd_isolate_summary_{a.ref}.tsv"), delimiter="\t")} + keep = {k for k, r in summ.items() if float(r["median_depth"]) >= a.min_depth} + grp = {} + if a.groups: + for r in csv.DictReader(open(a.groups), delimiter="\t"): + grp[r["run"]] = r["class"] + W = load_windows(f"{a.base}/bd_windows_{a.ref}.tsv.gz", keep) + runs = sorted(W) + print(len(runs), "isolates with median depth >=", a.min_depth) + seqs = sorted({s for r in runs for s in W[r]}) + minw = a.min_len // a.window + obs, store = [], {} + for seq in seqs: + rs = [r for r in runs if seq in W[r] and len(W[r][seq]) == len(W[runs[0]].get(seq, W[r][seq]))] + if len(rs) < a.min_full + a.min_var: + continue + starts = [x[0] for x in W[rs[0]][seq]] + cls = [[classify(x[1]) for x in W[r][seq]] for r in rs] + store[seq] = (rs, starts, cls) + flags = candidate_flags(cls, a.min_full, a.min_var) + for s, e in merge_regions(flags, starts, a.window, minw): + obs.append((seq, s, e)) + print(len(obs), "candidate regions >=", a.min_len, "bp") + rng = random.Random(a.seed) + null = [] + for _ in range(a.perms): + n = 0 + for seq, (rs, starts, cls) in store.items(): + L = len(starts) + rot = [] + for c in cls: + k = rng.randrange(L) + rot.append(c[k:] + c[:k]) + n += len(merge_regions(candidate_flags(rot, a.min_full, a.min_var), starts, a.window, minw)) + null.append(n) + with open(f"{a.out}/idiomorph_null_{a.ref}.tsv", "w") as fo: + fo.write("perm\tregions\n") + for i, n in enumerate(null): + fo.write(f"{i}\t{n}\n") + print("observed", len(obs), "null mean", round(statistics.mean(null), 2), "null max", max(null)) + + iv = paf_intervals(a.paf, "target" if a.ref == "CLFT044" else "query", 5000) + genes = read_genes(a.gff3) + gcols = ["seq", "start", "end", "length", "windows", "aligned_to_other_ref", "n_isolates", "n_full", "n_half", "n_low", + "n_other", "full_by_group", "half_by_group", "low_by_group", "het_median_half", "het_median_full", + "n_genes", "keyword_genes"] + with open(f"{a.out}/idiomorph_regions_{a.ref}.tsv", "w") as fo, open(f"{a.out}/idiomorph_genes_{a.ref}.tsv", "w") as fg: + fo.write("\t".join(gcols) + "\n") + fg.write("region\tgene\tstart\tend\ttext\n") + for seq, s, e in obs: + rs, starts, cls = store[seq] + idx = [i for i, st in enumerate(starts) if s <= st < e] + cnt = collections.Counter() + bygrp = {LOW: collections.Counter(), HALF: collections.Counter(), FULL: collections.Counter()} + hh, hf = [], [] + for ri, r in enumerate(rs): + cs = collections.Counter(cls[ri][i] for i in idx) + dom = max(cs, key=cs.get) # dominant class over the region + cnt[dom] += 1 + if dom in bygrp: + bygrp[dom][grp.get(r, "NA")] += 1 + het = [W[r][seq][i][2] for i in idx] + (hh if dom == HALF else hf if dom == FULL else []).append(statistics.median(het)) + gl = [g for g in genes.get(seq, []) if g[1] > s and g[0] <= e] + kw = [g for g in gl if KEYWORDS.search(g[3])] + fmt = lambda c: ";".join(f"{k}:{v}" for k, v in sorted(c.items())) + fo.write("\t".join(map(str, [seq, s, e, e - s, len(idx), round(covered(iv, seq, s, e), 3), len(rs), cnt[FULL], + cnt[HALF], cnt[LOW], cnt[OTHER], fmt(bygrp[FULL]), fmt(bygrp[HALF]), + fmt(bygrp[LOW]), round(statistics.median(hh), 1) if hh else "NA", + round(statistics.median(hf), 1) if hf else "NA", len(gl), + ";".join(g[2] for g in kw)])) + "\n") + for g in gl: + fg.write(f"{seq}:{s}-{e}\t{g[2]}\t{g[0]}\t{g[1]}\t{g[3][:150]}\n") + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_parent_of_origin.py b/scripts/bd_parent_of_origin.py new file mode 100644 index 00000000..58d45f2d --- /dev/null +++ b/scripts/bd_parent_of_origin.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +"""Parent-of-origin scan of Batrachochytrium isolates in CLFT044 coordinates. + +Idea: two reference assemblies (CLFT044 = Brazil lineage, JEL423 = reference for the other lineage) differ at +single-base sites. Along each sequence, the share of those sites where an isolate carries the JEL423 allele, and +whether it carries it in one or both copies, shows which lineage(s) the isolate resembles. + +Diploid reading: Bd isolates are diploid. At a divergent site a homozygous isolate has f near 0 (CLFT044 allele) or +1 (JEL423 allele); a heterozygous one has f near 0.5. An F1 hybrid should be heterozygous at divergent sites +genome-wide. Later-generation hybrids give a mosaic of CLFT, HET and JELHOM windows. Aneuploid or changed-ploidy +sequences give other fractions (for example 1/3 and 2/3), which also fall in the 0.2-0.8 het range; compare with +bd_depth_by_seq_.tsv before reading HET as hybrid. Within-lineage heterozygosity is not removed. + +Inputs + --paf minimap2 -c --cs=short alignment, query JEL423, target CLFT044 (JEL423_vs_CLFT044.paf.gz) + --base results folder with per_run_CLFT044/.snps.tsv.gz and .regions.bed.gz, and bd_runs.tsv + (the SNP files come from scripts/bd_coverage_isolates.slurm run against CLFT044) +Method + divergent sites '*xy' cs substitutions of primary alignments with block >= --min-block; a CLFT044 position + seen in more than one alignment is dropped. + site call a divergent site is "called" when the isolate SNP table has a biallelic row whose alt equals the + JEL423 base; its fraction f = alt/(ref+alt). Sites with no SNP row are NOT counted as CLFT044 + allele: on the JEL423 isolate itself about a third of divergent sites have no row (no reads + or no call), so absence is not evidence. Sites in 10 kb windows with depth < --min-depth, and + rows with another alt base or several alts, are skipped. + window --window bp in CLFT044 coordinates; kept when >= --min-sites usable divergent sites. + recovery r = called sites / usable sites; het share = called sites with 0.2 <= f <= 0.8. + class: r < --min-recovery -> 'CLFT' (JEL allele rare); else het share >= --het-share -> 'HET' + (JEL and CLFT alleles both present); else 'JELHOM'. + The thresholds are set from the two control isolates (JEL423 and CLFT044) and are not + validated on isolates of known hybrid status. +Outputs (in --out): parent_origin_summary.tsv, parent_origin_windows.tsv.gz +Limits: the SNP table keeps QUAL >= 30 only; recovery on the JEL423 control is below 1, so r is a relative score. +""" +import argparse +import collections +import gzip +import os +import re + +CS_TOKEN = re.compile(r"(:\d+|\*[a-z][a-z]|[+-][a-z]+)") + + +def divergent_sites(paf_path, min_block=5000): + """Return {(target, pos1): query_base} for single-base substitutions in primary alignments.""" + cover = collections.Counter() + sites = {} + op = gzip.open if paf_path.endswith(".gz") else open + with op(paf_path, "rt") as fh: + for line in fh: + f = line.rstrip("\n").split("\t") + if len(f) < 12 or int(f[10]) < min_block: + continue + tags = {t[:2]: t[5:] for t in f[12:] if len(t) > 5} + if tags.get("tp") not in (None, "P"): + continue + cs = tags.get("cs") + if not cs: + continue + tname, pos = f[5], int(f[7]) # 0-based target start + for tok in CS_TOKEN.findall(cs): + if tok[0] == ":": + pos += int(tok[1:]) + elif tok[0] == "*": + k = (tname, pos + 1) + cover[k] += 1 + sites[k] = tok[2].upper() + pos += 1 + elif tok[0] == "-": + pos += len(tok) - 1 + return {k: v for k, v in sites.items() if cover[k] == 1} + + +def read_depth_windows(path): + d = {} + with gzip.open(path, "rt") as fh: + for line in fh: + c, s, e, v = line.rstrip("\n").split("\t")[:4] + d[(c, int(s) // 10000 * 10000)] = float(v) + return d + + +def read_snps(path): + """{(chrom,pos): (alt, ref_count, alt_count)} for biallelic SNP rows.""" + out = {} + with gzip.open(path, "rt") as fh: + for line in fh: + f = line.rstrip("\n").split("\t") + if len(f) < 7 or "," in f[3]: + continue + try: + ad = [int(x) for x in f[6].split(",")] + except ValueError: + continue + if len(ad) == 2: + out[(f[0], int(f[1]))] = (f[3], ad[0], ad[1]) + return out + + +def site_calls(sites, snps, depth, min_depth): + """Yield (chrom, pos, f) per usable divergent site; f is None when the JEL base was not called.""" + for (c, p), jb in sites.items(): + if depth.get((c, (p - 1) // 10000 * 10000), 0) < min_depth: + continue + row = snps.get((c, p)) + if row is None: + yield c, p, None + elif row[0] == jb and (row[1] + row[2]) > 0: + yield c, p, row[2] / (row[1] + row[2]) + # another alt base: skipped + + +def classify(rec, het, min_recovery, het_share): + return "CLFT" if rec < min_recovery else "HET" if het >= het_share else "JELHOM" + + +def window_table(calls, window, min_sites, min_recovery=0.2, het_share=0.5): + """calls: iterable of (chrom,pos,f|None) -> sorted list of + (chrom,start,usable,called,recovery,het_share_of_called,class).""" + acc = collections.defaultdict(list) + for c, p, f in calls: + acc[(c, (p - 1) // window * window)].append(f) + rows = [] + for (c, s), v in acc.items(): + if len(v) < min_sites: + continue + called = [x for x in v if x is not None] + rec = len(called) / len(v) + het = sum(0.2 <= x <= 0.8 for x in called) / len(called) if called else 0.0 + rows.append((c, s, len(v), len(called), round(rec, 4), round(het, 4), + classify(rec, het, min_recovery, het_share))) + return sorted(rows) + + +def switches(rows): + """Class changes between neighbouring kept windows on the same sequence.""" + n, prev = 0, None + for r in rows: + if prev and prev[0] == r[0] and prev[1] != r[6]: + n += 1 + prev = (r[0], r[6]) + return n + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--paf", required=True) + ap.add_argument("--base", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--ref", default="CLFT044") + ap.add_argument("--window", type=int, default=50000) + ap.add_argument("--min-sites", type=int, default=20) + ap.add_argument("--min-depth", type=float, default=10.0) + ap.add_argument("--min-block", type=int, default=5000) + ap.add_argument("--min-recovery", type=float, default=0.5) + ap.add_argument("--het-share", type=float, default=0.5) + a = ap.parse_args() + os.makedirs(a.out, exist_ok=True) + sites = divergent_sites(a.paf, a.min_block) + print(len(sites), "divergent single-base sites") + meta = {} + for l in list(open(f"{a.base}/bd_runs.tsv"))[1:]: + f = l.rstrip("\n").split("\t") + meta[f[1]] = (f[0], f[3], f[4]) + cols = ["run", "group", "isolate", "country", "usable_sites", "called_sites", "recovery", "het_share_of_called", + "windows", "windows_CLFT", "windows_HET", "windows_JELHOM", "switches"] + with open(f"{a.out}/parent_origin_summary.tsv", "w") as fs, \ + gzip.open(f"{a.out}/parent_origin_windows.tsv.gz", "wt") as fw: + fs.write("\t".join(cols) + "\n") + fw.write("run\tseq\tstart\tusable\tcalled\trecovery\thet_share\tclass\n") + n = 0 + for run, (grp, iso, ctry) in meta.items(): + sp = f"{a.base}/per_run_{a.ref}/{run}.snps.tsv.gz" + dp = f"{a.base}/per_run_{a.ref}/{run}.regions.bed.gz" + if not (os.path.exists(sp) and os.path.exists(dp)): + continue + cl = list(site_calls(sites, read_snps(sp), read_depth_windows(dp), a.min_depth)) + if not cl: + continue + called = [x[2] for x in cl if x[2] is not None] + rows = window_table(cl, a.window, a.min_sites, a.min_recovery, a.het_share) + cnt = collections.Counter(r[6] for r in rows) + het = sum(0.2 <= v <= 0.8 for v in called) / max(1, len(called)) + fs.write("\t".join(map(str, [run, grp, iso, ctry, len(cl), len(called), round(len(called) / len(cl), 4), + round(het, 4), len(rows), cnt["CLFT"], cnt["HET"], cnt["JELHOM"], + switches(rows)])) + "\n") + for r in rows: + fw.write(run + "\t" + "\t".join(map(str, r)) + "\n") + n += 1 + print(n, "isolates") + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_report.py b/scripts/bd_report.py new file mode 100644 index 00000000..5125265f --- /dev/null +++ b/scripts/bd_report.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +"""Write the Batrachochytrium coverage / heterozygosity report (markdown, figure, tables) from the result tables. + +Inputs : --base results/2026-11-13_bd_coverage (bd_isolate_summary_.tsv, bd_depth_by_seq_.tsv, + parent_origin/parent_origin_summary.tsv, parent_origin/parent_origin_windows.tsv.gz, excluded_runs.tsv) +Outputs : --out report dir: report.md, figures/bd_summary.{png,pdf}, tables/*.tsv +All numbers in the markdown come from these tables, so a page and the tables agree. +Isolate classes (per isolate, from window fractions in parent_origin_windows): CLFT-type > 60% CLFT windows; +JEL-type > 60% JELHOM windows; HET-rich > 50% HET windows; otherwise mixed. +""" +import argparse +import collections +import csv +import gzip +import os +import shutil +import statistics + +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt # noqa: E402 + + +def rd(path): + return list(csv.DictReader(open(path), delimiter="\t")) + + +def cls(r): + c, h, j = (int(r[k]) / int(r["windows"]) for k in ("windows_CLFT", "windows_HET", "windows_JELHOM")) + return "CLFT-type" if c > .6 else "JEL-type" if j > .6 else "HET-rich" if h > .5 else "mixed" + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--base", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--code-commit", default="") + a = ap.parse_args() + for d in ("figures", "tables"): + os.makedirs(f"{a.out}/{d}", exist_ok=True) + J = {r["run"]: r for r in rd(f"{a.base}/bd_isolate_summary_JEL423.tsv")} + C = {r["run"]: r for r in rd(f"{a.base}/bd_isolate_summary_CLFT044.tsv")} + P = {r["run"]: r for r in rd(f"{a.base}/parent_origin/parent_origin_summary.tsv")} + for r in P.values(): + r["class"] = cls(r) + for f in ("bd_isolate_summary_JEL423.tsv", "bd_isolate_summary_CLFT044.tsv", "excluded_runs.tsv", "bd_runs_popseq.tsv"): + shutil.copy(f"{a.base}/{f}", f"{a.out}/tables/{f}") + shutil.copy(f"{a.base}/parent_origin/parent_origin_summary.tsv", f"{a.out}/tables/parent_origin_summary.tsv") + with open(f"{a.out}/tables/isolate_classes.tsv", "w") as fo: + fo.write("run\tgroup\tisolate\tcountry\tclass\tmedian_depth\tsnps_per_mb_JEL423\tsnps_per_mb_CLFT044\n") + for k, r in P.items(): + fo.write("\t".join([k, r["group"], r["isolate"], r["country"], r["class"], J[k]["median_depth"], + J[k]["snps_per_mb"], C[k]["snps_per_mb"]]) + "\n") + + col = {"CLFT-type": "#c0392b", "JEL-type": "#2471a3", "HET-rich": "#7d3c98", "mixed": "#7f8c8d"} + fig, ax = plt.subplots(1, 2, figsize=(11, 4.6)) + for c in col: + ks = [k for k in P if P[k]["class"] == c] + ax[0].scatter([float(J[k]["snps_per_mb"]) for k in ks], [float(C[k]["snps_per_mb"]) for k in ks], s=22, + c=col[c], label=f"{c} (n={len(ks)})") + ax[1].scatter([float(P[k]["recovery"]) for k in ks], [float(P[k]["het_share_of_called"]) for k in ks], s=22, + c=col[c], label=c) + ax[0].set_xlabel("SNPs/Mb against JEL423"); ax[0].set_ylabel("SNPs/Mb against CLFT044") + ax[0].legend(frameon=False, fontsize=8); ax[0].set_title("A. SNP density against the two references") + ax[1].set_xlabel("recovery of JEL423 alleles at divergent sites"); ax[1].set_ylabel("heterozygous share of called sites") + ax[1].set_title("B. Parent-of-origin summary per isolate") + fig.tight_layout() + fig.savefig(f"{a.out}/figures/bd_summary.png", dpi=150); fig.savefig(f"{a.out}/figures/bd_summary.pdf") + + runs = {r["run"]: r for r in rd(f"{a.base}/bd_runs.tsv")} + brazil = [k for k in P if P[k]["group"] == "brazil"] + other = [k for k in P if P[k]["group"] != "brazil"] + cnt = {g: collections.Counter(P[k]["class"] for k in ks) for g, ks in (("Brazil", brazil), ("Other", other))} + ctrl = {n: next(k for k in P if P[k]["isolate"] == n) for n in ("CLFT044", "JEL423")} + self_snp = {n: (J[k]["snps_per_mb"], J[k]["het_fraction"], C[k]["snps_per_mb"], C[k]["het_fraction"]) + for n, k in ctrl.items()} + seqdepth = {} + for ref in ("JEL423", "CLFT044"): + for r in rd(f"{a.base}/bd_depth_by_seq_{ref}.tsv"): + seqdepth.setdefault((ref, r["run"]), []).append(r) + het_rich = [k for k in P if P[k]["class"] == "HET-rich"] + mixed = [k for k in P if P[k]["class"] == "mixed"] + lowdepth = [k for k in P if float(J[k]["median_depth"]) < 20] + odd = [k for k in other if P[k]["class"] == "CLFT-type"] + excl = [l.rstrip("\n") for l in open(f"{a.base}/excluded_runs.tsv")][1:] if os.path.exists(f"{a.base}/excluded_runs.tsv") else [] + + def row(k): + p = P[k] + return (f"| {p['isolate']} | {p['country']} | {J[k]['median_depth']} | {J[k]['snps_per_mb']} | {C[k]['snps_per_mb']} | " + f"{p['recovery']} | {p['het_share_of_called']} | {int(p['windows_CLFT'])}/{int(p['windows_HET'])}/{int(p['windows_JELHOM'])} | {p['class']} |") + + hdr = ("| isolate | country | median depth | SNPs/Mb vs JEL423 | SNPs/Mb vs CLFT044 | recovery | het share of called | " + "windows CLFT/HET/JELHOM | class |\n|---|---|---|---|---|---|---|---|---|") + md = f"""# Batrachochytrium dendrobatidis: read depth, heterozygosity and parent of origin + +Status: exploratory analysis of public reads. Nothing here is curated or accepted. Bd isolates are diploid, and the +allele balance is read that way. + +Pipeline commit: `{a.code_commit}`. Jobs: JEL423 reference 32070127 and 32070630 (array 2-9); CLFT044 reference 32070128 and +32070631; reference alignment 32089404 (minimap2 2.30, `-x asm10 -c --cs=short`). Result folder on the HPCC: +`results/2026-11-13_bd_coverage/` (not committed; tables below are copies). + +## Data + +- Runs: {len(P)} runs analysed of {len(runs)} listed (Brazil {len(brazil)}, other countries {len(other)}), chosen from PopSeq + `catalog/runs/fungi_all_runs.csv.gz` (ENA snapshot 2026-11-06) and ENA. All were Illumina WGS. See `tables/bd_runs_popseq.tsv`. +- References: JEL423 (GCA_048537975.1) and UCR_BdCLFT044 (Brazil lineage per the curator). I did not verify the lineage of JEL423 here. +- Each run: `prefetch`, `fasterq-dump`, read-pair count checked against ENA `read_count`, `bwa-mem2`, duplicate removal, + `mosdepth` 10 kb windows (MAPQ 20), `bcftools` SNP calls (QUAL 30). +- Excluded runs (`tables/excluded_runs.tsv`): +{chr(10).join(' - ' + e.replace(chr(9), ': ') for e in excl)} + +## 1. Depth and SNP density + +Median depth of the {len(P)} isolates: {statistics.median(float(J[k]['median_depth']) for k in P):.1f}x (range +{min(float(J[k]['median_depth']) for k in P):.1f} to {max(float(J[k]['median_depth']) for k in P):.1f}). {len(lowdepth)} isolates have median depth below 20x; treat their numbers with more care. + +Isolates against their own reference (controls): + +| control | SNPs/Mb vs JEL423 | het fraction | SNPs/Mb vs CLFT044 | het fraction | +|---|---|---|---|---| +| CLFT044 reads | {self_snp['CLFT044'][0]} | {self_snp['CLFT044'][1]} | {self_snp['CLFT044'][2]} | {self_snp['CLFT044'][3]} | +| JEL423 reads | {self_snp['JEL423'][0]} | {self_snp['JEL423'][1]} | {self_snp['JEL423'][2]} | {self_snp['JEL423'][3]} | + +An isolate does not give near-zero SNPs against its own reference. Each reference is a haploid representation of a diploid +genome, so heterozygous sites are expected, and the het fraction is high (0.9). Repeats and paralogs can add het-like SNPs; +I did not separate the two causes. A het fraction alone therefore cannot call a hybrid. + +Depth flags: sequences of 200 kb or more with median depth outside 0.75 to 1.25 of the genome median occur in most isolates (0 to 11 per isolate) +(see `tables/bd_isolate_summary_*.tsv`, column `depth_flag_seqs`). I did not separate copy-number change from repeat or +assembly artefacts. Ploidy variation, including aneuploidy, is also known in Bd; I did not test it here. + +![SNP density and parent-of-origin summary](figures/bd_summary.png) [PDF](figures/bd_summary.pdf) + +Figure source: `tables/isolate_classes.tsv`, `tables/parent_origin_summary.tsv`; script `scripts/bd_report.py`. + +## 2. Parent of origin + +Method (`scripts/bd_parent_of_origin.py`): align JEL423 to CLFT044 and take single-base differences in primary alignments +(172,706 sites). In each isolate, a site is "called" when its CLFT044-reference SNP table has the JEL423 base. Per 50 kb +window: recovery = called sites / usable sites; het share = called sites with alt fraction 0.2 to 0.8. A window is `CLFT` +when recovery < 0.5, else `HET` when het share >= 0.5, else `JELHOM`. + +Why sites without a SNP row are not counted as CLFT044 allele: in the JEL423 isolate about a third of divergent sites have no row, +so absence is not evidence. I first counted them as CLFT044 and the JEL423 isolate then scored only 0.57 JEL fraction; that +version was dropped. + +Calibration: only two controls. In the CLFT044 isolate the window recovery has median 0.05 and 95th percentile 0.41. In the +JEL423 isolate the median is 0.87 and the 5th percentile 0.16. I set the cutoff at 0.5 from these. It is not validated on isolates +of known hybrid status. Isolate class: CLFT-type if over 60% CLFT windows, JEL-type if over 60% JELHOM windows, HET-rich if +over 50% HET windows, else mixed. + +| group | CLFT-type | JEL-type | HET-rich | mixed | +|---|---|---|---|---| +| Brazil (n={len(brazil)}) | {cnt['Brazil']['CLFT-type']} | {cnt['Brazil']['JEL-type']} | {cnt['Brazil']['HET-rich']} | {cnt['Brazil']['mixed']} | +| Other countries (n={len(other)}) | {cnt['Other']['CLFT-type']} | {cnt['Other']['JEL-type']} | {cnt['Other']['HET-rich']} | {cnt['Other']['mixed']} | + +Control isolates: CLFT044 is {cls(P[ctrl['CLFT044']])}; JEL423 is {cls(P[ctrl['JEL423']])}. + +### Isolates that are HET-rich or mixed + +{hdr} +{chr(10).join(row(k) for k in het_rich + mixed)} + +These isolates carry JEL423 alleles in most windows, mostly in one copy. That is the pattern expected for a first-generation +hybrid of the two lineages. It does not show that they are hybrids. Other explanations I did not exclude: a third lineage that shares +alleles with both references; aneuploidy; mapping effects at divergent sites. A hybrid call needs a tree or ancestry analysis and +a lineage reference beyond these two. Published context: a Bd-GPL x Bd-Brazil hybrid zone in the Serra da Graciosa, Parana (Jenkinson et al. 2016, +doi 10.1111/mec.13599). I did not compare my isolates with that study's samples. + +### Non-Brazil isolates that are CLFT-type + +{hdr} +{chr(10).join(row(k) for k in odd)} + +Their recovery is 0.33 and 0.37, well below the JEL-type isolates (about 0.6 to 0.75). They carry few alleles of either reference. +A third lineage is a possible reason; I did not check their lineage. + +## Limits + +- Two references only. Lineage names are the curator's for CLFT044 and my understanding for JEL423. +- SNP tables keep QUAL >= 30 and no per-site depth was stored, so absence of a call cannot be told from no coverage. +- Window class is noisy: the CLFT044 control has windows with recovery up to 0.6. +- The Brazil set is {len(brazil)} runs; PopSeq lists 58 Brazilian isolates, so the set is not all of them. + +## Next + +Add an ancestry or tree analysis with at least one more lineage reference (for example a BdASIA or BdCAPE assembly), and test +the HET-rich isolates for aneuploidy with allele balance by sequence. +""" + open(f"{a.out}/report.md", "w").write(md) + print("wrote", f"{a.out}/report.md", dict(cnt)) + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_site_allele_counts.py b/scripts/bd_site_allele_counts.py new file mode 100644 index 00000000..5cb918c2 --- /dev/null +++ b/scripts/bd_site_allele_counts.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +"""Count reads carrying the JEL423 or the CLFT044 base at the divergent single-base sites, from `samtools mpileup` text on stdin. + +For every pileup line at a site listed in --sites (TSV: contig, 1-based position, JEL423 base) the reads with the reference base (CLFT044: +'.' or ',') and the reads with the JEL423 base are counted; other bases and indels are ignored. Reads are counted once per site. +Output (--out, gzip TSV): contig, pos, n_clft, n_jel. +Summary (stdout) with --min-depth: sites with enough reads, and the share of those sites by JEL fraction f = n_jel / (n_clft + n_jel): + clft f <= 0.2 het 0.2 < f < 0.8 jel f >= 0.8 +Usage: samtools mpileup -l SITES.bed -f REF.fa -q 20 -Q 20 -B BAM | bd_site_allele_counts.py --sites SITES.tsv --out OUT.tsv.gz +""" +import argparse +import gzip +import re +import sys + +_INDEL = re.compile(r"[+-](\d+)") + + +def count_bases(bases, jel): + """(n_ref, n_jel) in an mpileup base string for one site. `jel` is the JEL423 base (upper case).""" + nref = njel = 0 + i, n = 0, len(bases) + jel = jel.upper() + while i < n: + ch = bases[i] + if ch == "^": + i += 2 + continue + if ch in "$*<>#": + i += 1 + continue + if ch in "+-": + m = _INDEL.match(bases, i) + i = m.end() + int(m.group(1)) + continue + if ch in ".,": + nref += 1 + elif ch.upper() == jel: + njel += 1 + i += 1 + return nref, njel + + +def classify(nref, njel, min_depth=5): + """'clft', 'het', 'jel' or None (too few reads).""" + tot = nref + njel + if tot < min_depth: + return None + f = njel / tot + return "clft" if f <= 0.2 else "jel" if f >= 0.8 else "het" + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--sites", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--min-depth", type=int, default=5) + a = ap.parse_args() + jel = {} + for line in open(a.sites): + c, p, b = line.rstrip("\n").split("\t") + jel[(c, int(p))] = b + tally = {"clft": 0, "het": 0, "jel": 0} + n_sites = 0 + with gzip.open(a.out, "wt") as fo: + fo.write("contig\tpos\tn_clft\tn_jel\n") + for line in sys.stdin: + f = line.rstrip("\n").split("\t") + if len(f) < 5: + continue + key = (f[0], int(f[1])) + if key not in jel: + continue + nref, njel = count_bases(f[4], jel[key]) + fo.write(f"{f[0]}\t{f[1]}\t{nref}\t{njel}\n") + c = classify(nref, njel, a.min_depth) + if c: + tally[c] += 1 + n_sites += 1 + tot = max(1, n_sites) + print(f"sites with >= {a.min_depth} reads: {n_sites}; clft {tally['clft'] / tot:.3f} het {tally['het'] / tot:.3f} jel {tally['jel'] / tot:.3f}") + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_site_genotype.slurm b/scripts/bd_site_genotype.slurm new file mode 100644 index 00000000..76d9fe4b --- /dev/null +++ b/scripts/bd_site_genotype.slurm @@ -0,0 +1,34 @@ +#!/usr/bin/bash -l +#SBATCH --job-name=bd-site +#SBATCH --partition=epyc +#SBATCH --cpus-per-task=4 +#SBATCH --mem=16gb +#SBATCH --time=6:00:00 +#SBATCH --output=/bigdata/stajichlab/jstajich/projects/MATPredict/logs/bdsite_%A_%a.log +# Depth-controlled read counts at the JEL423/CLFT044 divergent sites. Env: SRC (worktree), BASE (results/2026-11-13_bd_coverage), CHUNK (file, one run per line; +# array task N reads line N when RUNLIST is set), TARGET (depth to downsample to, default 12). +# Steps per run: read-count check against ENA, bwa-mem2 to CLFT044, duplicate removal, downsample to TARGET x (median depth from +# bd_isolate_summary_CLFT044.tsv; no downsampling if the run is at or below TARGET), samtools mpileup at the sites, bd_site_allele_counts.py. +set -uo pipefail +: "${SRC:?}" "${BASE:?}" +TARGET="${TARGET:-12}" +module load sratoolkit/3.2.0 bwa-mem2/2.2.1 samtools/1.22.1 +REF="$BASE/ref/CLFT044.fa"; OUT="$BASE/site_counts"; mkdir -p "$OUT" +W="${SCRATCH:?}/bdsite"; mkdir -p "$W" +run=$(sed -n "${SLURM_ARRAY_TASK_ID}p" "${RUNLIST:?}") +[[ -n "$run" ]] || { echo "no run for task"; exit 1; } +[[ -s "$OUT/$run.counts.tsv.gz" ]] && { echo "$run already done"; exit 0; } +exp=$(awk -F"\t" -v r="$run" '$2==r{print $7}' "$BASE/bd_runs.tsv") +med=$(awk -F"\t" -v r="$run" '$1==r{print $6}' "$BASE/bd_isolate_summary_CLFT044.tsv") +fasterq-dump "$BASE/sra/$run/$run.sra" -e 4 -O "$W" --temp "$W" --split-files -f > "$OUT/$run.fasterq.log" 2>&1 || { echo "FAIL fasterq $run"; exit 1; } +n1=$(( $(wc -l < "$W/${run}_1.fastq") / 4 )); n2=$(( $(wc -l < "$W/${run}_2.fastq") / 4 )) +if [[ "$n1" != "$exp" || "$n2" != "$exp" ]]; then echo "READ COUNT MISMATCH $run mate1=$n1 mate2=$n2 ena=$exp"; exit 1; fi +bwa-mem2 mem -t 4 -R "@RG\tID:$run\tSM:$run" "$REF" "$W/${run}_1.fastq" "$W/${run}_2.fastq" 2> "$OUT/$run.bwa.log" \ + | samtools fixmate -m -@ 2 - - | samtools sort -@ 2 -T "$W/st_$run" - | samtools markdup -r -@ 2 - "$W/$run.bam" +frac=$(awk -v m="$med" -v t="$TARGET" 'BEGIN{ if (m<=t) print 1; else printf "%.4f", t/m }') +if [[ "$frac" == "1" ]]; then cp "$W/$run.bam" "$W/$run.ds.bam"; else samtools view -b -s "7${frac#0}" -@ 2 "$W/$run.bam" > "$W/$run.ds.bam"; fi +samtools index "$W/$run.ds.bam" +echo "$run median_depth=$med downsample_fraction=$frac reads=$n1" +samtools mpileup -l "$BASE/ref/divergent_sites.bed" -f "$REF" -q 20 -Q 20 -B -d 1000 "$W/$run.ds.bam" 2> /dev/null \ + | python3 "$SRC/scripts/bd_site_allele_counts.py" --sites "$BASE/ref/divergent_sites.tsv" --out "$OUT/$run.counts.tsv.gz" | tee "$OUT/$run.summary.txt" +echo "$run done" diff --git a/scripts/bd_site_summary.py b/scripts/bd_site_summary.py new file mode 100644 index 00000000..315c6b56 --- /dev/null +++ b/scripts/bd_site_summary.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Table of the depth-controlled site counts per isolate (output of bd_site_genotype.slurm). + +Reads site_counts/.counts.tsv.gz (contig, pos, n_clft, n_jel) and the isolate classes, and writes for each run: the number of divergent +sites with at least --min-depth reads, the share with a JEL fraction f <= 0.2 (clft), 0.2 < f < 0.8 (het) and >= 0.8 (jel), and the same +shares on each of the sequences of --min-len bp or more when --by-sequence is given. +Output: TSV on stdout or --out. +""" +import argparse +import collections +import csv +import gzip +import os + + +def shares_from_counts(path, min_depth=5): + """-> (n_sites, {'clft': share, 'het': share, 'jel': share}, per_seq {seq: (n, shares)}).""" + tally = collections.Counter() + per = collections.defaultdict(collections.Counter) + with gzip.open(path, "rt") as fh: + next(fh) + for line in fh: + c, p, nr, nj = line.rstrip("\n").split("\t") + nr, nj = int(nr), int(nj) + if nr + nj < min_depth: + continue + f = nj / (nr + nj) + k = "clft" if f <= 0.2 else "jel" if f >= 0.8 else "het" + tally[k] += 1 + per[c][k] += 1 + n = sum(tally.values()) + sh = {k: (tally[k] / n if n else float("nan")) for k in ("clft", "het", "jel")} + ps = {} + for c, t in per.items(): + m = sum(t.values()) + ps[c] = (m, {k: t[k] / m for k in ("clft", "het", "jel")}) + return n, sh, ps + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--dir", required=True, help="site_counts folder") + ap.add_argument("--classes", required=True) + ap.add_argument("--summary", required=True, help="bd_isolate_summary_CLFT044.tsv (median depth)") + ap.add_argument("--out") + ap.add_argument("--min-depth", type=int, default=5) + ap.add_argument("--lengths", help="bd_depth_by_seq_CLFT044.tsv; with --by-sequence-out writes per-sequence shares for sequences of >= --min-len bp") + ap.add_argument("--by-sequence-out") + ap.add_argument("--min-len", type=int, default=500000) + a = ap.parse_args() + cls = {r["run"]: r for r in csv.DictReader(open(a.classes), delimiter="\t")} + dep = {r["run"]: r["median_depth"] for r in csv.DictReader(open(a.summary), delimiter="\t")} + per_run = {} + lines = ["run\tisolate\tclass\tmedian_depth_full\tsites\tshare_clft\tshare_het\tshare_jel"] + for f in sorted(os.listdir(a.dir)): + if not f.endswith(".counts.tsv.gz"): + continue + run = f[:-len(".counts.tsv.gz")] + n, sh, ps = shares_from_counts(os.path.join(a.dir, f), a.min_depth) + per_run[run] = ps + lines.append(f"{run}\t{cls[run]['isolate']}\t{cls[run]['class']}\t{dep[run]}\t{n}\t{sh['clft']:.3f}\t{sh['het']:.3f}\t{sh['jel']:.3f}") + if a.by_sequence_out and a.lengths: + L = {} + for r in csv.DictReader(open(a.lengths), delimiter="\t"): + L[r["seq"]] = int(r["length"]) + with open(a.by_sequence_out, "w") as fo: + fo.write("run\tisolate\tseq\tlength\tsites\tshare_clft\tshare_het\tshare_jel\n") + for run, ps in per_run.items(): + for seq, (m, sh) in sorted(ps.items()): + if L.get(seq, 0) >= a.min_len: + fo.write(f"{run}\t{cls[run]['isolate']}\t{seq}\t{L[seq]}\t{m}\t{sh['clft']:.3f}\t{sh['het']:.3f}\t{sh['jel']:.3f}\n") + text = "\n".join(lines) + "\n" + print(text) + if a.out: + open(a.out, "w").write(text) + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_snp_pca.py b/scripts/bd_snp_pca.py new file mode 100644 index 00000000..4d1ec97a --- /dev/null +++ b/scripts/bd_snp_pca.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +"""Isolate-level SNP ordination (PCA) of the Bd isolates from the SNP tables against one reference. + +Input --base results folder with per_run_/.snps.tsv.gz (bcftools table: CHROM POS REF ALT QUAL DP AD) and + bd_isolate_summary_.tsv (median_depth); --classes isolate_classes.tsv for labels +Method : biallelic SNPs on sequences of at least --min-len with DP >= 10 and within 0.5x to 2x of the isolate median depth. To keep memory + small only sites with POS % --thin == 0 are used. A site enters the matrix when at least --min-called isolates carry it and at + most --max-called share of isolates carry it (the fixed differences between the reference and almost all isolates carry no + structure). Entry = alternative allele fraction in that isolate; an isolate without a SNP row at the site gets 0 (the reference allele; + a missing row may also mean no coverage, so the matrix is biased toward zero at low depth). Columns are mean-centred and the + isolate x isolate PCA comes from the SVD. +Output : --out pca_scores.tsv (run, isolate, class, PC1..PC4, sites_called), pca_variance.tsv. +Limit : alt fraction is not a genotype call; low-depth isolates are noisy; the PCA shows relatedness in allele-fraction space, not a tree. +""" +import argparse +import collections +import csv +import gzip +import os + + +def thinned_sites(path, lo, hi, thin, bigset): + out = {} + with gzip.open(path, "rt") as fh: + for line in fh: + f = line.rstrip("\n").split("\t") + if len(f) < 7 or "," in f[3] or f[0] not in bigset: + continue + pos = int(f[1]) + if pos % thin: + continue + try: + dp = int(f[5]); ad = [int(x) for x in f[6].split(",")] + except ValueError: + continue + if len(ad) == 2 and sum(ad) and dp >= 10 and lo <= dp <= hi: + out[(f[0], pos)] = ad[1] / sum(ad) + return out + + +def main(): + import numpy as np + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--base", required=True) + ap.add_argument("--ref", default="CLFT044") + ap.add_argument("--classes", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--min-len", type=int, default=500000) + ap.add_argument("--thin", type=int, default=10) + ap.add_argument("--min-called", type=int, default=3) + ap.add_argument("--max-called", type=float, default=0.9) + a = ap.parse_args() + summ = {r["run"]: float(r["median_depth"]) for r in csv.DictReader(open(f"{a.base}/bd_isolate_summary_{a.ref}.tsv"), delimiter="\t")} + cls = {r["run"]: r for r in csv.DictReader(open(a.classes), delimiter="\t")} + runs = [r for r in summ if os.path.exists(f"{a.base}/per_run_{a.ref}/{r}.snps.tsv.gz") and r in cls] + lens = collections.defaultdict(int) + with open(f"{a.base}/bd_depth_by_seq_{a.ref}.tsv") as fh: + next(fh) + for line in fh: + f = line.split("\t") + lens[f[1]] = int(f[2]) + big = {s for s, l in lens.items() if l >= a.min_len} + data = {} + for r in runs: + d = summ[r] + data[r] = thinned_sites(f"{a.base}/per_run_{a.ref}/{r}.snps.tsv.gz", 0.5 * d, 2 * d, a.thin, big) + count = collections.Counter(s for v in data.values() for s in v) + keep = [s for s, n in count.items() if n >= a.min_called and n <= a.max_called * len(runs)] + idx = {s: i for i, s in enumerate(keep)} + X = np.zeros((len(runs), len(keep))) + for i, r in enumerate(runs): + for s, v in data[r].items(): + j = idx.get(s) + if j is not None: + X[i, j] = v + X -= X.mean(axis=0) + U, S, Vt = np.linalg.svd(X, full_matrices=False) + var = S ** 2 / (S ** 2).sum() + with open(a.out + "/pca_scores.tsv", "w") as fo: + fo.write("run\tisolate\tclass\tgroup\tPC1\tPC2\tPC3\tPC4\tsites_called\n") + for i, r in enumerate(runs): + sc = U[i, :4] * S[:4] + fo.write(f"{r}\t{cls[r]['isolate']}\t{cls[r]['class']}\t{cls[r]['group']}\t" + "\t".join(f"{x:.2f}" for x in sc) + f"\t{len(data[r])}\n") + with open(a.out + "/pca_variance.tsv", "w") as fo: + fo.write("PC\tvariance_share\n") + for k in range(6): + fo.write(f"PC{k + 1}\t{var[k]:.4f}\n") + print(len(runs), "isolates;", len(keep), "sites; variance PC1-4:", [round(float(x), 3) for x in var[:4]]) + + +if __name__ == "__main__": + main() diff --git a/scripts/bd_summarize.py b/scripts/bd_summarize.py new file mode 100644 index 00000000..3e4c7575 --- /dev/null +++ b/scripts/bd_summarize.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python3 +"""Summarise Batrachochytrium read-depth and heterozygosity per isolate. + +Inputs (from scripts/bd_coverage_isolates.slurm), in BASE/per_run_/: + .regions.bed.gz mosdepth mean depth in 10 kb windows + .snps.tsv.gz CHROM POS REF ALT QUAL DP AD (bcftools call -mv, SNPs, QUAL >= 30) +and BASE/bd_runs.tsv (group, run, isolate, country, ...). + +Per isolate (bd_isolate_summary.tsv): + mean_depth, median_depth over 10 kb windows + snps, snps_per_mb biallelic SNPs against the reference with DP >= MIN_DP and DP within + 0.5x..2x of the median depth + het_snps, het_fraction SNPs whose minor-allele fraction (MAF) is 0.2 to 0.5 inclusive + hom_alt_fraction SNPs with alt fraction >= 0.8 + het_per_mb het_snps per Mb of the genome (windows with depth) + het_windows_fraction share of 10 kb windows holding >= 3 het SNPs + depth_flag_seqs sequences of >= 200 kb whose median window depth is outside 0.75..1.25 of the + genome median (possible copy-number change; not a ploidy call) +Per sequence (bd_depth_by_seq.tsv): median depth ratio and het SNPs per Mb. +Per window (bd_windows.tsv.gz): run, seq, start, depth_ratio, snps, het. + +Heterozygosity here is allele balance in the reads, not a diploid genotype call. A reference-divergent +haploid isolate shows many hom_alt SNPs and few het SNPs; a hybrid or diploid shows het SNPs with MAF near 0.5. +Read mapping errors in repeats and paralogs also create het-like SNPs, so depth-filtered SNPs are used and +the windows table lets a reader remove outlier windows. +""" +import argparse +import collections +import gzip +import os +import statistics + +MIN_DP = 10 + + +def read_windows(path): + rows = [] + with gzip.open(path, "rt") as fh: + for line in fh: + c, s, e, d = line.rstrip("\n").split("\t")[:4] + rows.append((c, int(s), int(e), float(d))) + return rows + + +def parse_snps(path, median_depth): + lo, hi = 0.5 * median_depth, 2.0 * median_depth + with gzip.open(path, "rt") as fh: + for line in fh: + f = line.rstrip("\n").split("\t") + if len(f) < 7 or "," in f[3]: + continue # multiallelic + try: + dp = int(f[5]); ad = [int(x) for x in f[6].split(",")] + except ValueError: + continue + if len(ad) != 2 or dp < MIN_DP or not (lo <= dp <= hi) or sum(ad) == 0: + continue + yield f[0], int(f[1]), ad[1] / sum(ad) + + +def summarise_run(run, base, ref): + win = read_windows(f"{base}/per_run_{ref}/{run}.regions.bed.gz") + depths = [w[3] for w in win if w[3] > 0] + if not depths: + return None + med = statistics.median(depths) + nwin = collections.defaultdict(lambda: [0, 0]) # (chrom,start)-> [snps, het] + per_seq = collections.defaultdict(list) + for c, s, e, d in win: + per_seq[c].append(d) + snps = het = hom = 0 + seq_het = collections.Counter() + for c, pos, af in parse_snps(f"{base}/per_run_{ref}/{run}.snps.tsv.gz", med): + w = (c, (pos - 1) // 10000 * 10000) + nwin[w][0] += 1 + snps += 1 + if 0.2 <= af <= 0.8: + nwin[w][1] += 1; het += 1; seq_het[c] += 1 + elif af > 0.8: + hom += 1 + gsize = sum(e - s for _, s, e, d in win if d > 0) + flags, seq_rows = 0, [] + seq_len = collections.Counter() + for c, s, e, d in win: + seq_len[c] += e - s + for c, ds in per_seq.items(): + r = statistics.median(ds) / med if med else 0 + L = seq_len[c] + if L >= 200000 and not (0.75 <= r <= 1.25): + flags += 1 + seq_rows.append((run, c, L, round(r, 3), round(seq_het[c] / (L / 1e6), 1))) + hw = sum(1 for v in nwin.values() if v[1] >= 3) + row = dict(run=run, mean_depth=round(statistics.mean(depths), 1), median_depth=round(med, 1), snps=snps, + snps_per_mb=round(snps / (gsize / 1e6), 1) if gsize else 0, het_snps=het, + het_fraction=round(het / snps, 4) if snps else 0, hom_alt_fraction=round(hom / snps, 4) if snps else 0, + het_per_mb=round(het / (gsize / 1e6), 1) if gsize else 0, + het_windows_fraction=round(hw / max(1, len(win)), 4), depth_flag_seqs=flags) + wrows = [(run, c, s, round(d / med, 3), nwin[(c, s)][0], nwin[(c, s)][1]) for c, s, e, d in win] + return row, seq_rows, wrows + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--base", required=True) + ap.add_argument("--ref", default="JEL423", help="reference name used in per_run_") + a = ap.parse_args() + meta = {} + for l in list(open(f"{a.base}/bd_runs.tsv"))[1:]: + f = l.rstrip("\n").split("\t") + meta[f[1]] = dict(group=f[0], isolate=f[3], country=f[4]) + out_sum, out_seq = [], [] + with gzip.open(f"{a.base}/bd_windows_{a.ref}.tsv.gz", "wt") as fw: + fw.write("run\tseq\tstart\tdepth_ratio\tsnps\thet\n") + for run, m in meta.items(): + if not (os.path.exists(f"{a.base}/per_run_{a.ref}/{run}.snps.tsv.gz") and + os.path.exists(f"{a.base}/per_run_{a.ref}/{run}.regions.bed.gz")): + continue + r = summarise_run(run, a.base, a.ref) + if r is None: + continue + row, seqs, wrows = r + row.update(m) + out_sum.append(row); out_seq += seqs + for w in wrows: + fw.write("\t".join(map(str, w)) + "\n") + cols = ["run", "group", "isolate", "country", "mean_depth", "median_depth", "snps", "snps_per_mb", "het_snps", + "het_fraction", "hom_alt_fraction", "het_per_mb", "het_windows_fraction", "depth_flag_seqs"] + with open(f"{a.base}/bd_isolate_summary_{a.ref}.tsv", "w") as fo: + fo.write("\t".join(cols) + "\n") + for r in out_sum: + fo.write("\t".join(str(r[c]) for c in cols) + "\n") + with open(f"{a.base}/bd_depth_by_seq_{a.ref}.tsv", "w") as fo: + fo.write("run\tseq\tlength\tdepth_ratio\thet_per_mb\n") + for r in out_seq: + fo.write("\t".join(map(str, r)) + "\n") + print(len(out_sum), "isolates summarised") + + +if __name__ == "__main__": + main() diff --git a/tests/test_bd_coverage.py b/tests/test_bd_coverage.py new file mode 100644 index 00000000..c5abd82e --- /dev/null +++ b/tests/test_bd_coverage.py @@ -0,0 +1,210 @@ +"""Tests for the Batrachochytrium depth, heterozygosity and parent-of-origin scripts.""" +import gzip +import importlib.util +import pathlib + +SCRIPTS = pathlib.Path(__file__).resolve().parents[1] / "scripts" + + +def _load(name): + spec = importlib.util.spec_from_file_location(name, SCRIPTS / f"{name}.py") + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + +po = _load("bd_parent_of_origin") +bs = _load("bd_summarize") + + +def _paf(tmp_path, lines): + p = tmp_path / "x.paf.gz" + with gzip.open(p, "wt") as fo: + fo.write("\n".join(lines) + "\n") + return str(p) + + +def _line(tstart, cs, block=6000, tp="P", tname="T1"): + return "\t".join(["Q", "9000", "0", "6000", "+", tname, "9000", str(tstart), str(tstart + 6000), "5990", str(block), + "60", f"tp:A:{tp}", f"cs:Z:{cs}"]) + + +def test_divergent_sites_positions_and_deletions(tmp_path): + # 10 matches, substitution c->t at 1-based 11, 5 matches, 2-base deletion (target only), 3 matches, sub a->g at 1-based 22 + paf = _paf(tmp_path, [_line(0, ":10*ct:5-aa:3*ag")]) + assert po.divergent_sites(paf, 5000) == {("T1", 11): "T", ("T1", 22): "G"} + + +def test_divergent_sites_filters(tmp_path): + short = _line(0, ":10*ct", block=100) + secondary = _line(0, ":10*ct", tp="S") + assert po.divergent_sites(_paf(tmp_path, [short, secondary]), 5000) == {} + + +def test_divergent_site_covered_twice_is_dropped(tmp_path): + paf = _paf(tmp_path, [_line(0, ":10*ct"), _line(0, ":10*ct")]) + assert po.divergent_sites(paf, 5000) == {} + + +def test_site_calls_absent_is_not_reference_allele(): + sites = {("T1", 11): "T", ("T1", 12): "G", ("T1", 13): "A"} + snps = {("T1", 11): ("T", 5, 15), ("T1", 12): ("C", 4, 16)} # 12 has another alt base + depth = {("T1", 0): 30.0} + out = {p: f for _, p, f in po.site_calls(sites, snps, depth, 10)} + assert out == {11: 0.75, 13: None} + + +def test_site_calls_low_depth_window_skipped(): + assert list(po.site_calls({("T1", 11): "T"}, {}, {("T1", 0): 4.0}, 10)) == [] + + +def test_window_table_classes(): + calls = [("T1", p, None) for p in range(1, 21)] # 20 sites, none called -> CLFT + calls += [("T1", 50000 + p, 1.0) for p in range(1, 21)] # all hom JEL + calls += [("T1", 100000 + p, 0.5) for p in range(1, 21)] # all het + calls += [("T1", 150000 + p, 1.0) for p in range(1, 6)] # too few sites: dropped + rows = po.window_table(calls, 50000, 20) + assert [r[6] for r in rows] == ["CLFT", "JELHOM", "HET"] + assert rows[1][4] == 1.0 and rows[2][5] == 1.0 + assert po.switches(rows) == 2 + + +def test_switches_not_counted_across_sequences(): + rows = [("A", 0, 20, 20, 1.0, 0.0, "JELHOM"), ("B", 0, 20, 0, 0.0, 0.0, "CLFT")] + assert po.switches(rows) == 0 + + +def _write_run(base, ref, run, depths, snps): + d = base / f"per_run_{ref}" + d.mkdir(parents=True, exist_ok=True) + with gzip.open(d / f"{run}.regions.bed.gz", "wt") as fo: + for i, v in enumerate(depths): + fo.write(f"S1\t{i * 10000}\t{(i + 1) * 10000}\t{v}\n") + with gzip.open(d / f"{run}.snps.tsv.gz", "wt") as fo: + for pos, ref_, alt, dp, ad in snps: + fo.write(f"S1\t{pos}\t{ref_}\t{alt}\t50\t{dp}\t{ad}\n") + + +def test_summarise_run_het_and_depth(tmp_path): + depths = [30.0] * 20 + [60.0] * 20 # second half doubled + snps = [(100, "A", "G", 30, "15,15"), (200, "A", "G", 30, "1,29"), (300, "A", "C,G", 30, "10,10,10"), + (400, "A", "G", 5, "2,3"), (500, "A", "G", 30, "30,0")] + _write_run(tmp_path, "R", "RUN1", depths, snps) + row, seqs, wrows = bs.summarise_run("RUN1", str(tmp_path), "R") + # rows kept: 15,15 (het), 1,29 (hom alt), 30,0 (alt fraction 0); multiallelic and DP<10 rows are dropped + assert row["snps"] == 3 + assert row["het_snps"] == 1 + assert row["hom_alt_fraction"] == round(1 / 3, 4) + assert row["median_depth"] == 45.0 + assert len(wrows) == 40 + assert seqs[0][3] == 1.0 # one sequence: its median is the genome median + + +im = _load("bd_idiomorph_scan") + + +def test_idiomorph_classify(): + assert [im.classify(x) for x in (0.0, 0.1, 0.5, 1.0, 1.3, 0.7)] == [im.LOW, im.LOW, im.HALF, im.FULL, im.OTHER, im.OTHER] + + +def test_idiomorph_candidate_flags_and_merge(): + F, H, L = im.FULL, im.HALF, im.LOW + # 4 isolates, 5 windows: windows 1-2 have 2 FULL and 2 variant isolates + cls = [[F, F, F, F, F], [F, F, F, F, F], [F, H, H, F, F], [F, L, H, F, F]] + flags = im.candidate_flags(cls, min_full=2, min_var=2) + assert flags == [False, True, True, False, False] + assert im.merge_regions(flags, [0, 10000, 20000, 30000, 40000], 10000, 2) == [(10000, 30000)] + assert im.merge_regions(flags, [0, 10000, 20000, 30000, 40000], 10000, 3) == [] + + +def test_idiomorph_merge_breaks_on_gap(): + flags = [True, True, True] + assert im.merge_regions(flags, [0, 10000, 30000], 10000, 2) == [(0, 20000)] + + +def test_idiomorph_covered_fraction(): + iv = {"S": [[0, 5000], [8000, 20000]]} + assert im.covered(iv, "S", 0, 10000) == 0.7 + assert im.covered(iv, "X", 0, 10000) == 0.0 + + +an = _load("bd_aneuploidy") +an_af = _load("bd_aneuploidy_af") + + +def test_aneuploidy_normalise_and_flag(): + med, norm = an.normalise({"A": {"r1": 1.0, "r2": 1.0, "r3": 1.5}}) + assert med["A"] == 1.0 and norm[("A", "r3")] == 1.5 + assert an.flag(1.5, 0.25) and not an.flag(1.1, 0.25) and an.flag(0.5, 0.25) + + +def test_aneuploidy_af_fold_and_shares(): + assert abs(an_af.fold(0.7) - 0.3) < 1e-9 and an_af.fold(0.2) == 0.2 + n, third, half = an_af.shares([0.5, 0.48, 0.33, 0.35, 0.05, 0.4]) + assert n == 5 # 0.05 is not a het site + assert abs(third - 3 / 5) < 1e-9 and abs(half - 2 / 5) < 1e-9 + + +hr = _load("bd_hetrich_check") + + +def test_hetrich_window_classes(tmp_path): + p = tmp_path / "w.tsv.gz" + with gzip.open(p, "wt") as fo: + fo.write("run\tseq\tstart\tusable\tcalled\trecovery\thet_share\tclass\n") + for i, c in enumerate(["HET", "HET", "CLFT"]): + fo.write(f"R1\tS1\t{i * 50000}\t30\t20\t0.6\t0.5\t{c}\n") + fo.write("R2\tS1\t0\t30\t20\t0.6\t0.5\tJELHOM\n") + fo.write("R1\tS2\t0\t30\t20\t0.6\t0.5\tHET\n") + out = hr.window_classes(str(p), "R1", {"S1": 900000, "S2": 100}, 500000) + assert out == {"S1": {"HET": 2, "CLFT": 1}} + + +pca = _load("bd_snp_pca") + + +def test_pca_thinned_sites_filters(tmp_path): + p = tmp_path / "s.tsv.gz" + with gzip.open(p, "wt") as fo: + fo.write("S1\t100\tA\tG\t50\t30\t10,20\n") # kept: pos % 10 == 0, DP 30 in range, alt fraction 20/30 + fo.write("S1\t101\tA\tG\t50\t30\t10,20\n") # dropped by thinning + fo.write("S2\t100\tA\tG\t50\t30\t10,20\n") # dropped: sequence not in the big set + fo.write("S1\t110\tA\tG,T\t50\t30\t10,10,10\n") # dropped: multiallelic + fo.write("S1\t120\tA\tG\t50\t5\t2,3\n") # dropped: DP below 10 + fo.write("S1\t130\tA\tG\t50\t100\t50,50\n") # dropped: DP above 2x the median + out = pca.thinned_sites(str(p), 15, 60, 10, {"S1"}) + assert list(out) == [("S1", 100)] and abs(out[("S1", 100)] - 2 / 3) < 1e-9 + + +sc = _load("bd_site_allele_counts") + + +def test_count_bases_pileup_syntax(): + # 3 ref reads (. . ,), 2 JEL reads (G g), a read start mark with mapq char, an end mark, an insertion and a deletion marker + assert sc.count_bases("..,Gg", "G") == (3, 2) + assert sc.count_bases("^]A.$,+2ACG*", "A") == (2, 1) # ^] skips the mapq char; +2ACG skips 'AC'; the final G is in the insertion? no: skipped by length + assert sc.count_bases("-1N..", "G") == (2, 0) + assert sc.count_bases("AAT", "G") == (0, 0) + + +def test_classify_site(): + assert sc.classify(10, 0) == "clft" and sc.classify(0, 10) == "jel" and sc.classify(5, 5) == "het" + assert sc.classify(2, 1) is None + + +ss = _load("bd_site_summary") + + +def test_site_summary_shares(tmp_path): + p = tmp_path / "r.counts.tsv.gz" + with gzip.open(p, "wt") as fo: + fo.write("contig\tpos\tn_clft\tn_jel\n") + fo.write("S1\t1\t10\t0\n") # clft + fo.write("S1\t2\t5\t5\n") # het + fo.write("S1\t3\t0\t10\n") # jel + fo.write("S2\t4\t10\t1\n") # f = 0.09: clft + fo.write("S2\t5\t2\t1\n") # too few reads + n, sh, per = ss.shares_from_counts(str(p)) + assert n == 4 + assert abs(sh["clft"] - 0.5) < 1e-9 and abs(sh["het"] - 0.25) < 1e-9 and abs(sh["jel"] - 0.25) < 1e-9 + assert per["S2"][0] == 1 and per["S2"][1]["clft"] == 1.0