Добавил:
Sekretar
kiopkiopkiop18@yandex.ru
t.me/Prokururor I Вовсе не секретарь, но почту проверяю
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5529_Библиотеки_им_академика_М_И_Перельмана
.pdf
124 Bioinformatics of Autoimmune Diseases
Ultimately, the structured output of the script enables computational and statistical analyses,
including GWAS and variant enrichment analyses. By integrating this data with other biological
and clinical datasets, researchers can form hypotheses on how structural variations contribute to
autoimmune disease risk, progression, and response to treatment, paving the way for more targeted
therapeutic approaches.
4.2.1.2.7 Retrieving OMIM IDs for Autoimmune Disease Investigation
The OMIM database is a comprehensive, authoritative compendium of human genes and genetic
disorders, with a special focus on the relationships between genetic variation and disease phenotypes. OMIM serves as a crucial resource for researchers and clinicians, offering regularly updated
information on thousands of genetic conditions, including autoimmune diseases. Autoimmune disorders, characterized by an overactive immune response targeting the body’s own tissues, have
a strong genetic component, making OMIM an invaluable tool in understanding their molecular
underpinnings. By cataloging disease-related genes, mutations, and their associated phenotypes,
OMIM facilitates the identication of genetic risk factors, supports diagnostic efforts, and aids
in the development of targeted therapies. Its integration with other genomic databases and tools
enhances its utility in large-scale genetic studies, allowing researchers to uncover novel disease
mechanisms and potential treatment avenues.
import requests
def get_omim_phenotype_ids(disease_name):
base_url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.
fcgi"
params = {
"db": "omim",
"term": f"{disease_name} AND (Phenotype[tiab])",
"retmode": "json",
"retmax": 1000 # Adjust to retrieve more results if needed
}
response = requests.get(base_url, params=params)
if response.status_code == 200:
data = response.json()
return data.get("esearchresult", {}).get("idlist", [])
else:
print("Error fetching data:", response.status_code)
return []
def save_omim_ids_to_file(omim_ids, filename="omim_phenotype_ids.txt"):
with open(filename, "w") as file:
for omim_id in omim_ids:
file.write(f"{omim_id}\n")
print(f"OMIM phenotype IDs saved to {filename}")
# Example usage
disease_name = "Celiac Disease"
omim_phenotype_ids = get_omim_phenotype_ids(disease_name)
if omim_phenotype_ids:
save_omim_ids_to_file(omim_phenotype_ids)
else:
print("No OMIM phenotype IDs found.")
To harness the power of OMIM in studying autoimmune diseases, the above Python script
“omim _ by _ disease.py” can be used to extract phenotype-associated MIM numbers,
unique IDs assigned to genes, phenotypes, and genetic loci. The script queries the NCBI E-utilities
API, retrieving MIM numbers specically linked to an autoimmune disease phenotype. This is
achieved by structuring the search query to lter out genetic loci and focus exclusively on disease

125 Bioinformatics Databases
manifestations, ensuring that the returned dataset is relevant to clinical and genetic research. The
extracted MIM numbers are then saved to a le, making them easily accessible for further analysis.
These IDs serve as entry points into OMIM’s vast repository of genetic data, allowing researchers to explore gene–disease associations, inheritance patterns, and known pathogenic variants. By
leveraging this information, scientists can design targeted studies to identify genetic risk factors,
compare disease mechanisms across different autoimmune conditions, and rene diagnostic criteria. The script provides a streamlined method for automating database searches, reducing manual
effort while ensuring that researchers have access to the most up-to-date genetic information relevant to their studies.
4.2.1.2.8 Searching SRA for RNA-Seq, Small RNA, and ChIP-Seq Raw Data
Searching the NCBI SRA database for RNA-Seq, small RNA, and ChIP-Seq raw data related to
autoimmune disease studies provides researchers with a wealth of publicly available genomic datasets to advance their investigations. RNA-Seq data from autoimmune disease studies allow scientists to analyze gene expression proles across different cell types and disease conditions, helping
them identify dysregulated pathways and key molecular signatures associated with disease progression. By accessing raw RNA-Seq data, researchers can perform customized bioinformatic analyses,
apply novel normalization methods, or compare gene expression patterns across multiple studies,
leading to a deeper understanding of disease mechanisms and potential therapeutic targets.
Small RNA-Seq data available in SRA enables researchers to investigate the role of microRNAs (miRNAs) and other non-coding RNAs in autoimmune diseases, which are known to regulate
immune responses and inammation. By analyzing these datasets, scientists can identify differentially expressed small RNAs that may serve as biomarkers for disease diagnosis, prognosis, or
treatment response. Furthermore, integrating small RNA data with transcriptomic studies provides
insights into how miRNAs regulate gene expression in the context of autoimmunity, offering new
avenues for therapeutic intervention.
ChIP-Seq data, which captures protein–DNA interactions and chromatin modications, plays
a crucial role in studying the epigenetic landscape of autoimmune diseases. Researchers can use
publicly available ChIP-Seq datasets to examine transcription factor binding sites, histone modications, and other regulatory elements that inuence immune cell function and disease susceptibility.
By integrating ChIP-Seq data with RNA-Seq or small RNA datasets, scientists can explore gene regulatory networks that contribute to immune dysregulation, uncovering potential epigenetic targets
for drug development. The availability of these raw sequencing datasets in SRA empowers researchers by reducing the cost and time required for data generation, facilitating large-scale meta-analyses,
and promoting data reproducibility and collaboration in the eld of autoimmune disease research.
In the following, we discuss Python functions in “ncbi _ SRA _ search.py” that can be
used to retrieve metadata from FASTQ les of RNA-Seq, small RNA, and RNA-ChIP data in the
NCBI SRA database.
def search_sra(disease, seq_types, max_results=10):
query = (
f'("{disease}"[All Fields]) AND ('
f'{" OR ".join(seq_types)}[All Fields]'
f')'
)
handle = Entrez.esearch(db="sra", term=query, retmax=max_results)
record = Entrez.read(handle)
handle.close()
return record["IdList"]
The function s ea r ch _ sr a() is designed to search the NCBI SRA for sequencing studies
related to a specic disease and sequencing type. It constructs a query string that combines the

126 Bioinformatics of Autoimmune Diseases
disease name with sequencing methodologies such as RNA-Seq, small RNA, or ChIP-Seq. This
query string ensures that the search results are relevant to both the biological condition of interest
and the sequencing approach used in the study.
Once the query is formulated, the function calls Entrez.esearch(), a tool provided by the
Bio.E ntrez module, which allows users to programmatically search the NCBI databases. The
search is specically performed within the SRA database, which contains raw sequencing data
from thousands of biological studies. The function requests a maximum number of results as specied by the max _ results parameter, which defaults to 10 but can be adjusted based on user
needs. The retrieved data includes a list of SRA accession numbers, which uniquely identify studies
within the archive.
After executing the search, the function extracts the list of accession IDs from the response and
closes the connection to free system resources. These accession IDs are then returned as a Python
list, allowing further processing in the script. If no matching results are found, an empty list is
returned, ensuring that subsequent parts of the program can handle this case gracefully.
By encapsulating the search logic within a dedicated function, the script improves usability and
maintainability. Users can easily modify the disease name or sequencing methods without altering
the core implementation. Additionally, by limiting the number of retrieved results, the function
ensures efcient querying, reducing unnecessary computational overhead when searching large
datasets in the SRA database.
def fetch_sra_metadata(sra_id):
"""Fetch metadata for a given SRA ID and extract relevant fields."""
handle = Entrez.efetch(db="sra", id=sra_id, rettype="full",
retmode="xml")
xml_data = handle.read()
handle.close()
root = ET.fromstring(xml_data)
metadata = {
"SRA Accession": sra_id,
"Title": extract_text(root,
".//STUDY/DESCRIPTOR/STUDY_TITLE"),
"Organism": extract_text(root,
".//SAMPLE/SAMPLE_NAME/SCIENTIFIC_NAME"),
"Library Strategy": extract_text(root,
".//EXPERIMENT/DESIGN/LIBRARY_DESCRIPTOR/LIBRARY_STRATEGY"),
"Library Source": extract_text(root,
".//EXPERIMENT/DESIGN/LIBRARY_DESCRIPTOR/LIBRARY_SOURCE"),
"Experiment Accession": extract_text(root,
".//EXPERIMENT/IDENTIFIERS/PRIMARY_ID"),
"Run Accession": extract_text(root,
".//RUN_SET/RUN/IDENTIFIERS/PRIMARY_ID")
}
return metadata
The fetch _ sra _ metadata(sra _ id) function is responsible for retrieving detailed
metadata for a given SRA accession ID from the NCBI SRA. It takes an accession ID as input,
which represents a sequencing study stored in the database and uses the Entrez efetc h function to request the full metadata associated with that study. The response is returned in XML format, which contains structured information about the study, including its title, the organism used,
sequencing method, and library details.
Once the XML data is retrieved, the function parses it using Python’s x m l.et r ee.
ElementTree to extract key information. The function searches for specic metadata elds
such as the study title, which provides a brief description of the research, and the organism name,

127 Bioinformatics Databases
indicating the species from which the sequencing data was derived. It also retrieves the library
strategy, which species whether the sequencing method used was RNA-Seq, ChIP-Seq, or another
approach. Additionally, it extracts the library source, which describes whether the sequencing data
originated from genomic, transcriptomic, or metagenomic material.
Another crucial piece of information extracted by the function is the experiment accession, a
unique ID that links the study to a specic sequencing experiment. The most critical ID retrieved is
the run accession, which is necessary for downloading the raw sequencing data in FASTQ format.
This run accession is used to fetch sequencing reads through the SRA Toolkit, allowing researchers to analyze the raw sequencing data. If any of these metadata elds are missing in the XML
response, the function ensures robustness by returning “Not Available” instead of causing an error.
By encapsulating metadata retrieval within this function, the script becomes more structured and
reusable. Instead of manually parsing XML responses for each study, the function automates the
process, ensuring that key metadata is extracted in a standardized way. The retrieved information
is returned as a dictionary, making it easy to store, print, or process further. This modular approach
enhances the efciency of querying the SRA database, making it easier to access and analyze
sequencing studies relevant to autoimmune diseases or any other research topic.
def extract_text(root, xpath):
"""Helper function to safely extract text from an XML element."""
element = root.find(xpath)
return element.text if element is not None else "Not Available"
The function extract _ text() is designed to retrieve specic pieces of information from
an XML document. It takes two arguments: root, which represents the parsed XML structure, and
xpath, a string that species the location of the desired element within the XML hierarchy. The
function attempts to nd the element corresponding to the provided XPath query and extract its text
content. If the element exists, its text value is returned; otherwise, the function ensures that missing
elements do not cause an error by returning the placeholder string “Not Available” instead.
This approach is particularly useful when dealing with XML data from the NCBI SRA database,
where certain metadata elds might not always be present. For instance, while some studies provide
a clear study title and organism name, others may lack these elds or store them under different
XML structures. By using extract _ text(), the script can handle such inconsistencies grace-
fully, ensuring that missing values do not interrupt execution. Instead of raising an error when a tag
is absent, the function provides a default response, allowing the script to continue processing the
rest of the metadata without issue.
The function also improves code readability and modularity by abstracting the XML parsing
logic into a single reusable component. Without it, each metadata extraction step would require
repetitive XML navigation and error handling. By centralizing this functionality, the script remains
cleaner and more maintainable, as changes to how XML elements are retrieved can be made in one
place rather than being duplicated throughout the code. This design choice makes the script more
robust and adaptable to variations in the XML structure, ensuring it can retrieve sequencing metadata reliably even when some elds are missing.
def main():
disease = "rheumatoid arthritis" # Modify as needed
seq_types = ["RNA-Seq",
"small RNA OR Non-coding RNA OR ncRNA OR MicroRNA OR miRNA",
"ChIP-Seq"] # Modify to include/exclude methods
print("Searching SRA database...")
sra_ids = search_sra(disease, seq_types)
if not sra_ids:
print("No results found.")

128 Bioinformatics of Autoimmune Diseases
return
print("\nSRA Search Results:")
for sra_id in sra_ids:
metadata = fetch_sra_metadata(sra_id)
print("\n=== SRA Study Metadata ===")
for key, value in metadata.items():
print(f"{key}: {value}")
if __name__ == "__main__":
main()
The m a in() function initializes the search by specifying a disease, in this case, rheumatoid
arthritis, along with sequencing types such as RNA-Seq, small RNA or any of its synonyms, and
ChIP-Seq. It then calls the search _ sra() function, which constructs a query using the pro-
vided disease and sequencing types. This query is formatted to match the structure required by
NCBI’s SRA database, ensuring relevant studies are retrieved. The function then uses Entrez.
esearch() to perform the search and retrieve up to ten SRA accession IDs that match the query.
If no results are found, the function returns an empty list, and main() prints a message before
terminating.
If results are found, the script proceeds to retrieve detailed metadata for each study by calling
fetch _ sra _ metadata(). This function takes an SRA accession ID as input and queries the
database using E ntr ez.e fet c h() to fetch the full XML metadata associated with the study. The
XML response contains various nested elements that store key information such as the study title,
the organism used, the sequencing method, and the library preparation strategy. These elements
are extracted using extract _ text(), a helper function that ensures robustness by checking
whether an XML tag exists before attempting to access its text. If a requested eld is missing, the
function returns “Not Available” instead of causing an error.
After retrieving and processing metadata for each study, m a i n() prints the results in a structured format. The output includes the SRA accession number, which serves as a unique ID for the
study, along with the study title and the organism name. It also displays the library strategy, indicat-
ing whether the data was generated using RNA-Seq, small RNA-Seq, or ChIP-Seq, and the library
source, which species whether the data is genomic or transcriptomic. Additionally, it prints the
experiment accession and run accession numbers. The run accession is particularly important as it
enables users to download the corresponding FASTQ les containing raw sequencing reads. These
les can be obtained using tools such as prefetch and fasterq-dump from the SRA Toolkit.
The structured approach of the script ensures exibility and ease of modication. Users can
change the disease name or sequencing type without altering the core functionality. Additionally,
the use of modular functions allows for the script to be easily integrated into larger bioinformatics
pipelines. By dividing tasks into separate functions, the script remains readable, efcient, and reusable for different research applications.
The complete Python script, “ncbi _ SRA _ search.py”, is provided as supplementary
material.
Figure 4.3 shows metadata retrieved from the NCBI SRA for rheumatoid arthritis-related
sequencing studies. It includes the SRA accession, study title, organism, library strategy, library
source, and experiment/run accessions, with the run accession enabling FASTQ data retrieval. This
structured output helps researchers quickly identify relevant datasets for analysis.
4.2.2 UNIPROT DATABASE
The UniProt database is a fundamental resource for researchers studying proteins, providing comprehensive data on protein sequences, functions, and annotations. It contains information on protein
structures, interactions, subcellular localization, PTMs, and sequence variants. The UniProt API
allows programmatic access to this wealth of information, enabling researchers to retrieve specic

129 Bioinformatics Databases
FIGURE 4.3 The SRA metadata.
protein details efciently. By querying the API with a UniProt accession number or a protein name,
users can obtain structured data in JSON format, which includes elds such as protein function,
domains, enzyme classication, and links to related biological databases. JSON’s structured and
hierarchical nature makes it ideal for integrating protein data into computational workows, allowing for streamlined parsing and analysis. In bioinformatics pipelines, JSON-formatted responses
can be converted into Python dictionaries or Pandas data frames, making it easier to manipulate and
visualize large datasets. This is particularly useful in proteomics research, where batch retrieval of
multiple protein entries is necessary for large-scale analysis.
The Ensembl REST API complements the UniProt API by providing access to genomic data,
including gene annotations, sequence information, comparative genomics, and variant data.
Ensembl is an essential resource for studying genes, transcripts, and regulatory elements across
different species. Researchers can query the Ensembl API to retrieve detailed information about
genes, including their chromosomal coordinates, transcript isoforms, and functional annotations.
JSON responses from Ensembl contain structured data that can be easily parsed and analyzed, preserving complex biological relationships such as exon–intron structure, alternative splicing events,
and homologous gene mappings. Because the API supports requests for specic genes or genomic
regions, it enables targeted retrieval of relevant data for genetic studies, evolutionary research, and
clinical applications.
One of the signicant advantages of using JSON with these APIs is its compatibility with modern data science tools. JSON responses can be seamlessly integrated into Python-based workows
using libraries like requests and json , enabling automated data extraction and processing. The
hierarchical nature of JSON allows for efcient representation of gene–protein relationships, such
as mapping Ensembl gene IDs to UniProt protein entries. This is particularly valuable in integrative omics research, where genomic and proteomic data need to be linked to study gene function,
protein expression, and disease mechanisms.
Both the UniProt API and Ensembl REST API provide well-documented interactive endpoints
that allow researchers to test queries before implementation. Their RESTful nature ensures accessibility over HTTP, making them easy to use across different programming environments without
requiring additional software installation. By leveraging these APIs, researchers can systematically retrieve, analyze, and interpret biological data in a reproducible manner. The ability to integrate protein and genomic information through JSON-formatted responses enhances the efciency
of bioinformatics workows, supporting research in disease genetics and personalized medicine.
These APIs serve as crucial tools for advancing data-driven discoveries in life sciences.

130 Bioinformatics of Autoimmune Diseases
4.2.2.1 Understanding UniProt Protein Data Fields
In UniProt database, the information is structured in a machine-readable format such as JSON,
which enables seamless data integration and computational analysis. Each UniProt JSON entry
contains multiple elds, categorized into identication, sequence details, function, structure, interaction, and references. Below is a complete exploration of the main elds in a UniProt JSON entry.
4.2.2.1.1 entryType
The entryTy pe eld denes whether a UniProt entry is reviewed (Swiss-Prot) or unreviewed
(TrEMBL). Reviewed entries, like the one for HLA-A (P04439), have been manually curated,
ensuring high-quality annotation. This classication is essential for researchers to determine the
reliability of the data.
{
"entryType": "UniProtKB reviewed (Swiss-Prot)"
}
4.2.2.1.2 primaryAccession
The primaryAccession eld represents the unique ID assigned to a UniProt entry. This ID
is stable and does not change over time. In the case of HLA-A, its primary accession number is
P04439, ensuring consistent referencing across studies and databases.
{
"primaryAccession": "P04439"
}
4.2.2.1.3 secondaryAccessions
The secondaryAccessions eld lists additional accession numbers that were previously associated with the entry due to historical updates, merges, or alternative references. HLA-A has multiple
secondary accessions, such as “B1PKZ3” and “O02939”, ensuring continuity in research citations.
{
"secondaryAccessions": ["B1PKZ3", "O02939", "P10313", "Q9UQU7"]
}
4.2.2.1.4 uniProtkbId
The uniProtkbId eld provides the UniProtKB entry name, which is typically derived from
the gene symbol and species. For HLA-A, this ID is “HLAA_HUMAN”, representing the HLA-A
protein in humans.
{
"uniProtkbId": "HLAA_HUMAN"
}
4.2.2.1.5 entryAudit
The e ntr yAudit eld contains historical metadata about the UniProt entry, such as the rst
release date, the last annotation update, and the entry version number. HLA-A was rst published
in 1987, last updated in 2025, and is currently on version 221.

131 Bioinformatics Databases
{
"entryAudit": {
"firstPublicDate": "1987-08-13",
"lastAnnotationUpdateDate": "2025-02-05",
"lastSequenceUpdateDate": "2003-08-22",
"entryVersion": 221,
"sequenceVersion": 2
}
}
4.2.2.1.6 annotationScore
The annotationScore represents UniProt’s condence in the completeness and accuracy of
the annotation. This score ranges from 1 to 5, with 5 indicating highly curated and experimentally
validated information. HLA-A has an annotation score of 5, reecting its well-documented status.
{
"annotationScore": 5.0
}
4.2.2.1.7 organism
The organism eld provides taxonomic information about the species from which the protein
originates. For HLA-A, the species is H. sapiens (human), with taxonomy ID 9606. The lineage
species its classication under Eukaryota, Metazoa, and Mammalia.
{
"organism": {
"scientificName": "Homo sapiens",
"commonName": "Human",
"taxonId": 9606,
"lineage":["Eukaryota","Metazoa","Chordata","Vertebrata","Mammalia"]
}
}
4.2.2.1.8 proteinExistence
The proteinExistence eld indicates the level of experimental evidence supporting the protein’s existence. HLA-A is classied under “Evidence at protein level”, meaning that direct proteinlevel evidence has been obtained.
{
"proteinExistence": "1: Evidence at protein level"
}
4.2.2.1.9 proteinDescription
The proteinDescription eld provides a full description of the protein. The recommended
name for HLA-A is “HLA class I histocompatibility antigen, A alpha chain”, and it has an alternative name “Human leukocyte antigen A”.
{
"proteinDescription": {
"recommendedName": {
"fullName": {
"value": "HLA class I histocompatibility antigen, A alpha chain"

132 Bioinformatics of Autoimmune Diseases
}
},
"alternativeNames": [
{
"fullName": {
"value": "Human leukocyte antigen A"
},
"shortNames": [
{
"value": "HLA-A"
}
]
}
],
"flag": "Precursor"
}
}
4.2.2.1.10 ge nes
The genes eld details the gene name encoding the protein. For HLA-A, the gene name is “HLAA”, with an evidence reference from HGNC (HGNC:4931). A synonym for this gene is “HLAA”.
{
"genes": [
{
"geneName": {
"value": "HLA-A",
"evidences": [
{
"evidenceCode": "ECO:0000312",
"source": "HGNC",
"id": "HGNC:4931"
}
]
},
"synonyms": [
{
"value": "HLAA"
}
]
}
]
}
4.2.2.1.11 co m m ents
The comments eld contains detailed functional annotations, including the protein’s biological
role. HLA-A functions as an antigen-presenting molecule, displaying peptides from viruses and
tumors to CD8-positive T cells.
{
"comments": [
{
"commentType": "FUNCTION",
"texts": [
{

133 Bioinformatics Databases
"value": "Antigen-presenting major histocompatibility complex
class I (MHCI) molecule. Displays primarily viral and tumor-derived peptides
for recognition by alpha-beta T cell receptor on CD8-positive T cells.",
"evidences": [
{
"evidenceCode": "ECO:0000269",
"source": "PubMed",
"id": "10449296"
}
]
}
]
}
]
}
4.2.2.1.12 fe atures
The features eld describes key structural elements and PTMs. This includes glycosylation sites,
disulde bonds, and phosphorylation sites.
{
"features": [
{
"type": "Modified residue",
"location": {
"start": {
"value": 343
}
},
"description": "Phosphoserine",
"evidences": [
{
"evidenceCode": "ECO:0007744",
"source": "PubMed",
"id": "24275569"
}
]
},
{
"type": "Glycosylation",
"location": {
"start": {
"value": 110
}
},
"description": "N-linked (GlcNAc...) asparagine",
"evidences": [
{
"evidenceCode": "ECO:0000269",
"source": "PubMed",
"id": "19159218"
}
]
}
]
}
Соседние файлы в папке Библиотека им академика М.И. Перельмана
