removing md5,adding mindel,converting to more familiar file formats and updating readme
Browse files- README.md +43 -154
- brentlab_features.csv.gz +3 -0
- brentlab_features.parquet.md5 +0 -1
- gal_tss_sgd-5-1_verified_orf.bed.md5 +0 -1
- intergenic_regions_5_1.bed.md5 +0 -1
- intergenic_regions_5_1.fasta.gz.md5 +0 -1
- intergenic_regions_metadata_5_1.csv.md5 +0 -1
- median_across_conds_tss_sgd-5-1_verified_orf.bed.md5 +0 -1
- mindel_promoters.csv.gz +3 -0
- mindel_promoters.parquet +3 -0
- scripts/create_promoter_bed_from_mindel.R +137 -0
- ypd_tss_sgd-5-1_verified_orf.bed.md5 +0 -1
README.md
CHANGED
|
@@ -3,165 +3,54 @@ license: mit
|
|
| 3 |
pretty_name: BrentLab Yeast Genome Resources
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
-
dataset_info:
|
| 7 |
-
features:
|
| 8 |
-
- name: start
|
| 9 |
-
dtype: int32
|
| 10 |
-
description: Start coordinate (1-based, **inclusive**)
|
| 11 |
-
- name: end
|
| 12 |
-
dtype: int32
|
| 13 |
-
description: End coordinate (1-based, **inclusive**)
|
| 14 |
-
- name: strand
|
| 15 |
-
dtype: string
|
| 16 |
-
levels:
|
| 17 |
-
- +
|
| 18 |
-
- "-"
|
| 19 |
-
description: Strand of feature
|
| 20 |
-
- name: type
|
| 21 |
-
dtype: string
|
| 22 |
-
levels:
|
| 23 |
-
- gene
|
| 24 |
-
- ncRNA_gene
|
| 25 |
-
- tRNA_gene
|
| 26 |
-
- snoRNA_gene
|
| 27 |
-
- transposable_element_gene
|
| 28 |
-
- pseudogene
|
| 29 |
-
- telomerase_RNA_gene
|
| 30 |
-
- snRNA_gene
|
| 31 |
-
- rRNA_gene
|
| 32 |
-
- blocked_reading_frame
|
| 33 |
-
description: classification of feature
|
| 34 |
-
- name: locus_tag
|
| 35 |
-
dtype: string
|
| 36 |
-
description: Systematic ID of feature
|
| 37 |
-
- name: symbol
|
| 38 |
-
dtype: string
|
| 39 |
-
description: Common name of feature
|
| 40 |
-
- name: alias
|
| 41 |
-
dtype: string
|
| 42 |
-
description: Alternative names of feature, typically alternative symbols
|
| 43 |
-
- name: source
|
| 44 |
-
dtype: string
|
| 45 |
-
description: Annotation file version/origin of the feature
|
| 46 |
-
- name: note
|
| 47 |
-
dtype: string
|
| 48 |
-
description: Additional feature information, typically the description from the
|
| 49 |
-
SGD gff/gtf
|
| 50 |
-
partitioning:
|
| 51 |
-
keys:
|
| 52 |
-
- name: chr
|
| 53 |
-
dtype: string
|
| 54 |
-
levels:
|
| 55 |
-
- chrI
|
| 56 |
-
- chrII
|
| 57 |
-
- chrVII
|
| 58 |
-
- chrV
|
| 59 |
-
- chrIII
|
| 60 |
-
- chrIV
|
| 61 |
-
- chrVIII
|
| 62 |
-
- chrVI
|
| 63 |
-
- chrX
|
| 64 |
-
- chrIX
|
| 65 |
-
- chrXI
|
| 66 |
-
- chrXIV
|
| 67 |
-
- chrXII
|
| 68 |
-
- chrXIII
|
| 69 |
-
- chrXV
|
| 70 |
-
- chrXVI
|
| 71 |
-
- chrM
|
| 72 |
-
configs:
|
| 73 |
-
- config_name: features
|
| 74 |
-
default: true
|
| 75 |
-
data_files:
|
| 76 |
-
- split: train
|
| 77 |
-
path:
|
| 78 |
-
- features/*/part-0.parquet
|
| 79 |
---
|
| 80 |
# BrentLab Yeast Genome Resources
|
| 81 |
|
| 82 |
-
This Dataset stores resources meant to
|
| 83 |
-
curated by the Brent Lab
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
- **
|
| 90 |
-
- **
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
(TSS) coordinates for verified ORFs aggregated across different experimental
|
| 94 |
-
conditions.
|
| 95 |
-
- **ypd_tss_sgd-5-1_verified_orf**: Genomic coordinates of Transcription Start Sites
|
| 96 |
(TSS) for verified ORFs under standard YPD (rich medium) culture conditions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
## Usage
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
download the parquet datasets directly from hugging face by clicking on
|
| 103 |
-
"Files and Versions", or by using the huggingface_cli and duckdb directly.
|
| 104 |
-
In both cases, this provides a method of retrieving dataset and field definitions.
|
| 105 |
-
|
| 106 |
-
### `tfbpapi`
|
| 107 |
-
|
| 108 |
-
After [installing tfbpapi](https://github.com/BrentLab/tfbpapi/?tab=readme-ov-file#installation),
|
| 109 |
-
you can adapt this [tutorial](https://brentlab.github.io/tfbpapi/tutorials/hfqueryapi_tutorial/)
|
| 110 |
-
in order to explore the contents of this repository.
|
| 111 |
-
|
| 112 |
-
### huggingface_cli/duckdb
|
| 113 |
-
|
| 114 |
-
You can retrieves and displays the file paths for each configuration of
|
| 115 |
-
the "BrentLab/yeast_genome_resources" dataset from Hugging Face Hub.
|
| 116 |
-
|
| 117 |
-
```python
|
| 118 |
-
from huggingface_hub import ModelCard
|
| 119 |
-
from pprint import pprint
|
| 120 |
-
|
| 121 |
-
card = ModelCard.load("BrentLab/yeast_genome_resources", repo_type="dataset")
|
| 122 |
-
|
| 123 |
-
# cast to dict
|
| 124 |
-
card_dict = card.data.to_dict()
|
| 125 |
-
|
| 126 |
-
# Get partition information
|
| 127 |
-
dataset_paths_dict = {d.get("config_name"): d.get("data_files")[0].get("path") for d in card_dict.get("configs")}
|
| 128 |
-
|
| 129 |
-
pprint(dataset_paths_dict)
|
| 130 |
-
```
|
| 131 |
-
|
| 132 |
-
You may access just the Dataset metadata like this:
|
| 133 |
-
```python
|
| 134 |
-
from huggingface_hub import ModelCard
|
| 135 |
-
|
| 136 |
-
card = ModelCard.load("BrentLab/yeast_genome_resources", repo_type="dataset")
|
| 137 |
-
|
| 138 |
-
# cast to dict
|
| 139 |
-
card_dict = card.data.to_dict()
|
| 140 |
-
|
| 141 |
-
# Get partition information
|
| 142 |
-
card_dict.get("dataset_info").get("partitioning").get("keys")
|
| 143 |
-
```
|
| 144 |
-
|
| 145 |
-
If you wish to pull the entire repo, due to its size you may need to use an
|
| 146 |
-
[authentication token](https://huggingface.co/docs/hub/en/security-tokens).
|
| 147 |
-
If you do not have one, try omitting the token related code below and see if
|
| 148 |
-
it works. Else, create a token and provide it like so:
|
| 149 |
-
|
| 150 |
-
```python
|
| 151 |
-
repo_id = "BrentLab/yeast_genome_resources"
|
| 152 |
-
|
| 153 |
-
hf_token = os.getenv("HF_TOKEN")
|
| 154 |
-
|
| 155 |
-
# Download entire repo to local directory
|
| 156 |
-
repo_path = snapshot_download(
|
| 157 |
-
repo_id=repo_id,
|
| 158 |
-
repo_type="dataset",
|
| 159 |
-
token=hf_token
|
| 160 |
-
)
|
| 161 |
-
|
| 162 |
-
print(f"\n✓ Repository downloaded to: {repo_path}")
|
| 163 |
-
|
| 164 |
-
# Construct path to the rossi_annotated_features parquet file
|
| 165 |
-
parquet_path = os.path.join(repo_path, "brentlab_features.parquet")
|
| 166 |
-
print(f"✓ Parquet file at: {parquet_path}")
|
| 167 |
-
```
|
|
|
|
| 3 |
pretty_name: BrentLab Yeast Genome Resources
|
| 4 |
language:
|
| 5 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
# BrentLab Yeast Genome Resources
|
| 8 |
|
| 9 |
+
This Dataset stores resources meant to aid in the exploration of yeast -omic data,
|
| 10 |
+
curated by the Brent Lab.
|
| 11 |
+
|
| 12 |
+
## Terminology
|
| 13 |
+
|
| 14 |
+
Across all datasets in the BrentLab collection, we use the following terms consistently
|
| 15 |
+
|
| 16 |
+
- **locus_tag**: The systematic ID of an ORF. Eg, YKL038W
|
| 17 |
+
- **symbol**: The common name of an ORF. Eg, RGT1
|
| 18 |
+
- **target**: when the genomic locus is the 'target' of location of measurement, then
|
| 19 |
+
it is referred to as a 'target'. Eg, in RNAseq, the column `target_locus_tag` would
|
| 20 |
+
store the counts over that gene.
|
| 21 |
+
- **regulator**: This collection is made up of binding location assays, and perturbation
|
| 22 |
+
of transcription factors and chromatin interacting proteins, which I refer to generally
|
| 23 |
+
as 'regulators'
|
| 24 |
+
|
| 25 |
+
This repo provides the following:
|
| 26 |
+
|
| 27 |
+
You can find these by clicking on the [files and versions](https://huggingface.co/datasets/BrentLab/yeast_genome_resources/tree/main) tab. The file format is noted.
|
| 28 |
+
|
| 29 |
+
- **brentlab_features** (csv): This is a simplified version of the
|
| 30 |
+
SGD S288C-R64-3-1 annotations. We have used this file to standardize target
|
| 31 |
+
and regulator `locus_tag` and `symbol` across the other datasets in this collection.
|
| 32 |
+
- **yiming_promoters** (bed): The promoter regions used in
|
| 33 |
+
[Kang et al in the Dual threshold optimization paper](https://genome.cshlp.org/content/30/3/459).
|
| 34 |
+
These promoter regions are used for callingcards.
|
| 35 |
+
- **mindel_promoters** (csv): The promoters used by the Barkai lab to evaluate the
|
| 36 |
+
overlap between perturbation and binding in the Mahendrawada 2025 set in
|
| 37 |
+
[this preprint](https://www.biorxiv.org/content/10.1101/2025.10.12.681120v1.abstract).
|
| 38 |
+
See scripts/create_promoter_bed_from_mindel.R.
|
| 39 |
+
- **gal_tss_sgd-5-1_verified_orf** (bed): Genomic coordinates of Transcription Start Sites
|
| 40 |
+
(TSS) for verified ORFs under Galactose culture conditions. These are derived from
|
| 41 |
+
annotation version S288C-R64-5-1. See scripts/create_tss_files.R
|
| 42 |
+
- **median_across_conds_tss_sgd-5-1_verified_orf** (bed): Median Transcription Start Site
|
| 43 |
(TSS) coordinates for verified ORFs aggregated across different experimental
|
| 44 |
+
conditions. See scripts/create_tss_files.R
|
| 45 |
+
- **ypd_tss_sgd-5-1_verified_orf** (bed): Genomic coordinates of Transcription Start Sites
|
| 46 |
(TSS) for verified ORFs under standard YPD (rich medium) culture conditions.
|
| 47 |
+
See scripts/create_tss_files.R
|
| 48 |
+
- **intergenic_regions_5_1** (bed and fasta): Both the genomic coordinates and sequences
|
| 49 |
+
of the intergenic regions in version S288C-R64-5-1. See scripts/parse_intergenic_regions.R
|
| 50 |
+
- **chrmap** (csv): This file provides a mapping between chromosome names between, eg
|
| 51 |
+
UCSC, ensembl, etc.
|
| 52 |
|
| 53 |
## Usage
|
| 54 |
|
| 55 |
+
Currently, we expect that this will be used for its raw files, eg by downloading a given
|
| 56 |
+
file and opening it in your favorite program.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
brentlab_features.csv.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8af3315ab44818c28f009fcc879d9d950b4fc5f6eb446cb7d43370c984fd305
|
| 3 |
+
size 690751
|
brentlab_features.parquet.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
d1d88c50a03846b23894d1c20a86b231 brentlab_features.parquet
|
|
|
|
|
|
gal_tss_sgd-5-1_verified_orf.bed.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
fba1b195e3ba61575ff63d8f7e332173 gal_tss_sgd-5-1_verified_orf.bed
|
|
|
|
|
|
intergenic_regions_5_1.bed.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
328a943c457125e070d760f135077cad intergenic_regions_5_1.bed
|
|
|
|
|
|
intergenic_regions_5_1.fasta.gz.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
a6406d6da363177fe2be496035e24f33 intergenic_regions_5_1.fasta.gz
|
|
|
|
|
|
intergenic_regions_metadata_5_1.csv.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
b665e559400eaa0f2e08e6dd4f807c21 intergenic_regions_metadata_5_1.csv
|
|
|
|
|
|
median_across_conds_tss_sgd-5-1_verified_orf.bed.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
d997a383e9eed6ccf6a3fa4e035fafcd median_across_conds_tss_sgd-5-1_verified_orf.bed
|
|
|
|
|
|
mindel_promoters.csv.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab77901f7c665f3c95e8ae5723c04bfa57d6070df490e6698568fce52be54d14
|
| 3 |
+
size 1434190
|
mindel_promoters.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52c702ef6d75e87d5b193589bbf633506ff5b728c7ea85700008f2f1becf8b46
|
| 3 |
+
size 2244143
|
scripts/create_promoter_bed_from_mindel.R
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
library(tidyverse)
|
| 2 |
+
library(here)
|
| 3 |
+
library(Biostrings)
|
| 4 |
+
|
| 5 |
+
# see https://scholar.google.com/citations?view_op=view_citation&hl=en&user=cW9tmRMAAAAJ&sortby=pubdate&citation_for_view=cW9tmRMAAAAJ:mlAyqtXpCwEC
|
| 6 |
+
#
|
| 7 |
+
# and the associated github repo
|
| 8 |
+
# https://github.com/vmindel/ChEC_Target_Selection/tree/main
|
| 9 |
+
#
|
| 10 |
+
# I am using data/prom_seqs
|
| 11 |
+
|
| 12 |
+
chrmap = read_csv("~/code/hf/yeast_genome_resources/chrmap.csv.gz")
|
| 13 |
+
|
| 14 |
+
prom_seq = read_csv("~/projects/ChEC_Target_Selection/data/promoter_sequences.csv") %>%
|
| 15 |
+
mutate(norm_seq = ifelse(strand == "positive", tolower(seq), tolower(rseq)))
|
| 16 |
+
# note that this has the orf coordinates. Additionally, the start/stop are not
|
| 17 |
+
# oriented correctly by strand, so a negative strand start is greater than
|
| 18 |
+
# its stop. Not useful.
|
| 19 |
+
prom_orf_df = read_csv("~/projects/ChEC_Target_Selection/data/promoter_definitions.csv") %>%
|
| 20 |
+
select(-`...1`) %>%
|
| 21 |
+
left_join(
|
| 22 |
+
chrmap %>%
|
| 23 |
+
select(numbered, ucsc) %>%
|
| 24 |
+
mutate(numbered = as.integer(numbered)) %>%
|
| 25 |
+
dplyr::rename(chr_loc = numbered,
|
| 26 |
+
chr = ucsc)) %>%
|
| 27 |
+
select(-chr_loc) %>%
|
| 28 |
+
dplyr::relocate(chr)
|
| 29 |
+
|
| 30 |
+
# at this point, I wrote the seqs out to a fasta
|
| 31 |
+
|
| 32 |
+
# Write sequences to FASTA
|
| 33 |
+
seqs <- DNAStringSet(toupper(prom_seq$seq))
|
| 34 |
+
names(seqs) <- prom_seq$name
|
| 35 |
+
writeXStringSet(seqs, here("data/prom_seqs.fa"))
|
| 36 |
+
|
| 37 |
+
# installed blat in a conda
|
| 38 |
+
# env with conda create -n blat -c bioconda blat
|
| 39 |
+
|
| 40 |
+
# and then ran blat on the seqs
|
| 41 |
+
# blat sacCer3.2bit prom_seqs.fa output.pslx -out=pslx -minScore=700
|
| 42 |
+
|
| 43 |
+
pslx = read_tsv(here("data/output.pslx"), skip = 5, col_names = c(
|
| 44 |
+
"matches", "misMatches", "repMatches", "nCount",
|
| 45 |
+
"qNumInsert", "qBaseInsert", "tNumInsert", "tBaseInsert",
|
| 46 |
+
"strand", "qName", "qSize", "qStart", "qEnd",
|
| 47 |
+
"tName", "tSize", "tStart", "tEnd",
|
| 48 |
+
"blockCount", "blockSizes", "qStarts", "tStarts", "qSeq", "tSeq")) %>%
|
| 49 |
+
mutate(qSeq = trimws(str_remove(qSeq, ",")))
|
| 50 |
+
|
| 51 |
+
# then I read in the blat output and joined it to the prom_seqs and prom_orf_df
|
| 52 |
+
# in order to filter down to the correct promoter alignments
|
| 53 |
+
# NOTE: i verified that after all of this, the qSeq == norm_seq for all
|
| 54 |
+
promoter_coordinates_df = pslx %>%
|
| 55 |
+
# join on the orf coordinates -- these will be used to filter out among
|
| 56 |
+
# promoters with multiple perfect full length alignments (there are some!)
|
| 57 |
+
left_join(prom_orf_df, by = c('qName' = 'name', 'tName' = 'chr')) %>%
|
| 58 |
+
# accept only perfect alignments on the same chr as the orf with
|
| 59 |
+
# no mismatches or inserts
|
| 60 |
+
filter(complete.cases(.), misMatches == 0, qNumInsert==0, qBaseInsert==0) %>%
|
| 61 |
+
# there are some loci with multiple perfect alignments (probably due to
|
| 62 |
+
# repeats). count these and add as a column
|
| 63 |
+
group_by(qName) %>%
|
| 64 |
+
mutate(promoter_exact_aligns = n()) %>%
|
| 65 |
+
ungroup() %>%
|
| 66 |
+
# the correct alignment should start at the 5' end of the gene
|
| 67 |
+
arrange(qName) %>%
|
| 68 |
+
mutate(corr_align = case_when(
|
| 69 |
+
strand == "-" & tStart == start ~ TRUE,
|
| 70 |
+
strand == "+" & tEnd == start ~ TRUE,
|
| 71 |
+
.default = FALSE)) %>%
|
| 72 |
+
# only accept those alignments that begin at the 5' end of the orf
|
| 73 |
+
filter(corr_align) %>%
|
| 74 |
+
arrange(desc(promoter_exact_aligns)) %>%
|
| 75 |
+
ungroup() %>%
|
| 76 |
+
select(tName, tStart, tEnd, qName, qSize, strand, qSeq, promoter_exact_aligns)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
# map the features to the brent and mahendrawada features
|
| 80 |
+
mahendrawada_features = arrow::read_parquet("~/code/hf/mahendrawada_2025/features_mahendrawada_2025.parquet")
|
| 81 |
+
brent_features = arrow::read_parquet("~/code/hf/yeast_genome_resources/brentlab_features.parquet")
|
| 82 |
+
|
| 83 |
+
brent_features_map = promoter_coordinates_df %>%
|
| 84 |
+
select(qName) %>%
|
| 85 |
+
# try to join by symbol first
|
| 86 |
+
left_join(select(brent_features, locus_tag, symbol),
|
| 87 |
+
by = c('qName' = 'symbol')) %>%
|
| 88 |
+
# next, where the symbol is actually a locus tag, join by locus tag
|
| 89 |
+
left_join(
|
| 90 |
+
select(brent_features, locus_tag) %>%
|
| 91 |
+
mutate(tmp = locus_tag) %>%
|
| 92 |
+
dplyr::rename(qName = locus_tag)) %>%
|
| 93 |
+
# where there is a tmp (meaning it is actually a locus_tag), replace
|
| 94 |
+
# the NA in locus_tag with that
|
| 95 |
+
mutate(locus_tag = ifelse(is.na(locus_tag), tmp, locus_tag)) %>%
|
| 96 |
+
# drop the tmp column
|
| 97 |
+
select(-tmp) %>%
|
| 98 |
+
# next, search the aliases for a match to the qName. If one is found, then
|
| 99 |
+
# use the corresponding locus_tag. Like before, where the locus_tag column
|
| 100 |
+
# is NA and an alias was found, replace locus_tag with the corresponding
|
| 101 |
+
# value in tmp and then drop the tmp column
|
| 102 |
+
mutate(tmp = map_chr(qName, function(q) {
|
| 103 |
+
idx <- str_detect(brent_features$alias, fixed(q))
|
| 104 |
+
idx[is.na(idx)] <- FALSE
|
| 105 |
+
if (any(idx)) brent_features$locus_tag[which(idx)[1]] else NA_character_})) %>%
|
| 106 |
+
mutate(locus_tag = ifelse(is.na(locus_tag), tmp, locus_tag)) %>%
|
| 107 |
+
select(-tmp) %>%
|
| 108 |
+
# remove this -- it is a -1 frameshift from AAD6. The fact the coordinates
|
| 109 |
+
# are different in this, and the two therefore had different promoters
|
| 110 |
+
# makes me question the value of these loci. I removed both
|
| 111 |
+
filter(!qName %in% c("AAD6", "AAD16")) %>%
|
| 112 |
+
# after this, only AAD16, ADE5_7, ARG5_6 and DUR1_2 are left. These were
|
| 113 |
+
# identified by searching SGD
|
| 114 |
+
mutate(locus_tag = case_when(
|
| 115 |
+
qName == "ADE5_7" ~ "YGL234W",
|
| 116 |
+
qName == "ARG5_6" ~ "YER069W",
|
| 117 |
+
qName == "DUR1_2" ~ "YBR208C",
|
| 118 |
+
.default = locus_tag)) %>%
|
| 119 |
+
left_join(
|
| 120 |
+
select(brent_features, locus_tag, symbol)) %>%
|
| 121 |
+
mutate(in_mahendrawada_features = locus_tag %in% mahendrawada_features$gene_id)
|
| 122 |
+
|
| 123 |
+
promoter_coordinates_final = promoter_coordinates_df %>%
|
| 124 |
+
left_join(brent_features_map) %>%
|
| 125 |
+
dplyr::rename(
|
| 126 |
+
chr = tName,
|
| 127 |
+
start = tStart,
|
| 128 |
+
end = tEnd,
|
| 129 |
+
mindel_name = qName,
|
| 130 |
+
target_locus_tag = locus_tag,
|
| 131 |
+
target_symbol = symbol,
|
| 132 |
+
promoter_sequence = qSeq) %>%
|
| 133 |
+
select(chr, start, end, mindel_name, target_locus_tag, target_symbol,
|
| 134 |
+
strand, promoter_sequence,
|
| 135 |
+
in_mahendrawada_features, promoter_exact_aligns)
|
| 136 |
+
|
| 137 |
+
# write_csv(promoter_coordinates_final, "~/code/hf/yeast_genome_resources/mindel_promoters.csv.gz")
|
ypd_tss_sgd-5-1_verified_orf.bed.md5
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
a97586b6a73b5ff0d368786b72227186 ypd_tss_sgd-5-1_verified_orf.bed
|
|
|
|
|
|