Добавил:
Sekretar
kiopkiopkiop18@yandex.ru
t.me/Prokururor I Вовсе не секретарь, но почту проверяю
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5529_Библиотеки_им_академика_М_И_Перельмана
.pdf
104 Bioinformatics of Autoimmune Diseases
Parsing XML is a crucial step in extracting structured data from biological datasets, such
as genomic information. A GenBank XML le contains essential information about a genetic
sequence, including the organism’s name, chromosome location, nucleotide sequence, and relevant
publications. By using Python’s xml.etree.ElementTree module, we can efciently traverse
the XML structure and extract meaningful data in a structured format.
The rst step in parsing the XML le is loading it into memory and parsing its structure using E T.
parse(file _ path). Th is creates a tree representation of the XML document, where each node corresponds to an XML element. The root of the document serves as the entry point for extracting relevant
data. To retrieve specic elements, we use XPath-like queries such as root.find("Organism"),
which navigates the hierarchy to locate the desired tags. If an element is not found, handling missing
values ensures that the program remains robust and does not crash due to unexpected data structures.
Similarly, publications are stored in a nested structure where each article is represented as a
dictionary containing the PubMed ID and the title of the study. Iterating through multiple publications using root.findall("Pu blications/Publication") allows us to build a list of all
relevant studies linked to the gene.
The output of the script is a structured dictionary containing all key information from the XML
le. This format is particularly useful for further processing, such as converting the data into
JavaScript Object Notation (JSON) or integrating it into a database. By parsing the XML in this
way, researchers can automate data extraction, facilitating large-scale genomic analyses without the
need for manual intervention. The approach ensures that essential genomic and bibliographic data
are readily accessible for further computational or statistical analysis.
The above is just an example of parsing XML data. The elds in the XML vary by database.
Before parsing an XML le, study its structure, identify the elds you want to extract information
from, and then follow the above steps to retrieve data.
4.2.1.1.2 JSON Fo r mat
JSON is a lightweight, text-based format that provides structured data in a human-readable form.
It is particularly suitable for web applications and API-based interactions due to its simplicity and
ease of parsing in programming languages like JavaScript, Python, and R. JSON is commonly used
in PubMed, Gene, ClinVar, and GEO databases, where rapid querying and visualization of data are
required. Indexed elds in JSON include unique database IDs (such as GeneID and SNP ID), sequence
annotations, disease associations, and structured citations from scientic literature. JSON provides
an efcient way to fetch and process data dynamically, making it ideal for automated workows.
For example, assume we have a JSON le “e x a m p l e.j s o n ” with the following content:
{
"Organism": "Homo sapiens",
"CommonName": "human",
"Chromosome": "6",
"Location": "6p22.1",
"Sequence": "ATGCGTACGTTAGCGT...",
"Publications": [
{
"PMID": "38946372",
"Title": "Genetic study of a rare … the HLA-A/C loci in both parents."
},
{
"PMID": "38809622",
"Title": "HLA-A, HLA-B, and HLA-DRB1 … in an Iranian population."
}
]
}

For the given JSON le, you can use the following Python script “parse _ json.py” to parse
it and retrieve data from its elds.
import json
# Define the file path for the JSON file
file_path = "example.json"
# Load and parse the JSON file
with open(file_path, "r", encoding="utf-8") as file:
data = json.load(file)
# Extract relevant details
organism = data.get("Organism", "Not Found")
common_name = data.get("CommonName", "Not Found")
chromosome = data.get("Chromosome", "Not Found")
location = data.get("Location", "Not Found")
sequence = data.get("Sequence", "Not Found")
publications = data.get("Publications", [])
# Display the extracted information
print(f"Organism: {organism}")
print(f"Common Name: {common_name}")
print(f"Chromosome: {chromosome}")
print(f"Location: {location}")
print(f"Sequence: {sequence}\n")
print("Publications:")
for pub in publications:
print(f" PMID: {pub['PMID']}")
print(f" Title: {pub['Title']}\n")
105 Bioinformatics Databases
When you run the above code, the output will be as follows:
Organism: Homo sapiens
Common Name: human
Chromosome: 6
Location: 6p22.1
Sequence: ATGCGTACGTTAGCGT...
Publications:
PMID: 38946372
Title: Genetic study of a rare … the HLA-A/C loci in both parents.
PMID: 38809622
Title: HLA-A, HLA-B, and HLA-DRB1 … in an Iranian population.
Parsing the JSON le in Python involves reading the le, extracting key biological data, and
displaying it in a structured manner. The script rst opens the le using the o pe n() function in
read mode with UTF-8 encoding to ensure compatibility with any special characters. The json.
loa d() function is then used to parse the JSON content, converting it into a Python dictionary.
Once the JSON data is loaded, the script retrieves individual elds using the .g e t() method,
which allows safe extraction of values while providing default values if a key is missing. The organism’s name, common name, chromosome, and location are extracted directly from the top-level
dictionary. The nucleotide sequence is also retrieved.
For publications, the script iterates over the list stored under the “Pu blications” key. Each
entry in this list represents a dictionary containing a PubMed ID (“PMID”) and a title. The loop
prints both pieces of information for each publication, maintaining clarity and structure in the
output. This method ensures that all relevant information is displayed in a human-readable format
while preserving the hierarchy of the original JSON structure.
By following this approach, the script efciently extracts and presents key genomic data without
unnecessary complexity. The use of .g e t() ensures robustness, preventing potential errors if any

106 Bioinformatics of Autoimmune Diseases
eld is missing in the JSON le. The structured output format makes it easy to analyze or integrate
the extracted data into further computational processes, such as converting it into a structured database or using it in bioinformatics pipelines.
Just like the XML format, you need to study the structure of a JSON le and then use the json
module, as shown above, to parse the data.
4.2.1.1.3 FASTA Format
FASTA (FAST-All) is a widely used text-based format for storing nucleotide and protein sequences.
Each sequence entry in FASTA format begins with a header line, prexed by a greater-than symbol
(>), followed by sequence data in a single-letter code representation. FASTA is essential in bioin-
formatics for sequence alignment, BLAST searches, and comparative genomics. Common indexed
elds include sequence IDs such as accession numbers (e.g., NM_001256125 for messenger RNA
(mRNA) or NP_000240 for protein sequences), taxonomic classication, and annotations describing the function of the sequence. FASTA is commonly retrieved from GenBank, RefSeq, Protein,
and SRA databases, particularly for molecular biology studies involving sequence comparisons.
The following are two sequences in FASTA format (save them in “ex a m p le.fasta”).
>seq1
ATGCGTACGTAGCTAGCTAGCTAGCTAGCTA
>seq2
CGTAGCTAGCTAGCTGATCGATCGATCGTACG
You can use Biopython module to parse the FASTA le. Save the following code in a le
“parse _ fasta.p y ” and run it.
from Bio import SeqIO
fasta_file = "example.fasta"
# Parse the FASTA file and print sequences
for record in SeqIO.parse(fasta_file, "fasta"):
id = record.id
seq = record.seq
print(f"Sequence ID: {id}")
print(f"Sequence: {seq}")
The output will be as follows:
Sequence ID: seq1
Sequence: ATGCGTACGTAGCTAGCTAGCTAGCTAGCTA
Sequence ID: seq2
Sequence: CGTAGCTAGCTAGCTGATCGATCGATCGTACG
The script begins by importing the SeqIO module from Biopython, which is essential for handling biological sequence les in various formats, including FASTA. The path to the FASTA le
is dened as “ex am ple.fasta”, assuming that the le contains DNA sequences in the standard
FASTA format. The script then calls Se qIO.pa r se(), which reads the FASTA le and returns an
iterator over SeqRecord objects, each representing a sequence entry in the le.
Within the loop, each SeqRecord object is accessed, allowing retrieval of both the sequence
ID and the nucleotide sequence. The ID, stored in r eco rd.id, corresponds to the header line in
the FASTA le that begins with the “>” symbol, such as seq1 or seq2. The actual sequence, rep-
resented as a Seq object, is obtained using record.seq, which provides the nucleotide sequence
associated with the ID. Each sequence and its corresponding ID are printed on the console, separated by a horizontal line of dashes to improve readability. This ensures that every entry in the
FASTA le is processed in a structured and human-readable format.

107 Bioinformatics Databases
4.2.1.1.4 GenBank Format
GenBank format is a at-le format that provides comprehensive sequence annotations, including
gene features, coding regions, regulatory elements, and bibliographic references. It is structured into
three main sections: the header, the feature table, and the sequence data. Indexed elds in GenBank
format include locus name, accession number, organism name, reference citations, gene symbols,
and exon/intron annotations. It is commonly used in GenBank, RefSeq, and dbGaP databases for
retrieving complete genomic, transcriptomic, and proteomic datasets. The format is highly detailed
and supports the study of genetic variation, genome annotations, and functional elements within
biological sequences.
LOCUS SCU49845 5028 bp DNA linear PLN 21-JUN-1999
DEFINITION Saccharomyces cerevisiae TCP1-beta gene, complete cds.
ACCESSION U49845
VERSION U49845.1
KEYWORDS .
SOURCE Saccharomyces cerevisiae (baker's yeast)
ORGANISM Saccharomyces cerevisiae
Eukaryota; Fungi; Ascomycota; Saccharomycotina; Saccharomycetes;
Saccharomycetales; Saccharomycetaceae; Saccharomyces.
REFERENCE 1 (bases 1 to 5028)
AUTHORS Torpey,L.E., Gibbs,P.E., Nelson,J. and Lawrence,C.W.
TITLE Cloning and sequence of the yeast DNA repair gene RAD4
JOURNAL Unpublished (1996)
FEATURES Location/Qualifiers
source 1..5028
/organism="Saccharomyces cerevisiae"
/mol_type="genomic DNA"
gene 1..206
/gene="TCP1-beta"
CDS 1..206
/gene="TCP1-beta"
/codon_start=1
/transl_table=1
/product="TCP1-beta"
/protein_id="AAA98665.1"
/translation="MENSDSNFKNQLSLAAQKRNRPLLFVAGGEGKSTQIQSLQ"
ORIGIN
1 atgaaaaatc tgactccaat ttgaagaacc aactgtcttt ggcagcccag
51 aaacgcaacc gccctgctct tcgtagcagg tggcgaaggg aagagcactc
101 atccagagcc ttcag
//
Save the above in a GenBank le “ex am ple.gb” and use the following Biopython script
“par se _ gb.p y” and run it to parse the GenBank le:
from Bio import SeqIO
# Parse the GenBank file
genbank_file = "example.gb"
with open(genbank_file, "r") as handle:
record = SeqIO.read(handle, "genbank")
# Print sequence
id = record.id
seq = record.seq
print("Sequence ID:", id)

108 Bioinformatics of Autoimmune Diseases
print("Sequence Length:", len(seq))
print("Sequence:\n", seq)
The output will be as follows:
Sequence ID: U49845.1
Sequence Length: 5028
Sequence:
GATCCTCCATATACAACGGTATCTCCACCTCA…
4.2.1.1.5 FASTQ Files
The FASTQ (FASTA + quality) le format is a widely used text-based format for storing both biological sequence data and the corresponding quality scores obtained from high-throughput sequencing technologies. Each record in a FASTQ le represents a single sequencing read and contains four
lines. The rst line begins with an “@” character followed by a unique ID for the read, which often
includes information about the sequencing run, lane, tile, and coordinates. The second line contains
the nucleotide sequence of the read, composed of standard DNA bases (A, T, C, G) and possibly
ambiguous characters (e.g., N for unknown bases).
The third line, starting with a “+” character, serves as a separator and may repeat the ID found in
the rst line, although this repetition is optional and often omitted in modern les. The fourth and
nal line encodes the quality scores for each base in the sequence, using ASCII characters to represent the Phred-scaled probabilities of base-calling errors. Each character corresponds to a numerical value indicating the condence in the accuracy of the base call at that position. For example,
a Phred score of 20 implies a 1% chance of an incorrect base call. The following is an example of
FASTQ-formatted sequences:
@SEQ_ID_1
GATTTGGGGTTTAAAGGGAA
+
@BCDEFGHIJKLMNOPQRST
@SEQ_ID_2
CCTTAACCCGTAGGCTTACG
+
!''*((((***+))%%%++)(
FASTQ les are essential for downstream bioinformatics workows such as quality control,
read trimming, alignment to reference genomes, and variant calling. The format supports both
single-end and paired-end sequencing data, with paired-end reads typically stored in two separate
FASTQ les, one for each read direction. Due to their simple structure and widespread compatibility, FASTQ les have become a standard input format for most next-generation sequencing (NGS)
4.2.1.1.6 SR A Files
SRA format is a specialized binary format used for storing raw high-throughput sequencing reads
generated by NGS platforms. The format supports efcient storage and retrieval of large sequencing datasets and is compatible with the SRA Toolkit for downstream analysis. Indexed elds in
SRA include experiment accession numbers (e.g., SRX1234567), sample metadata (e.g., tissue type,
sequencing platform), and sequencing read quality metrics. The SRA database serves as a repository for whole-genome sequencing, transcriptome proling, and metagenomic studies, enabling
researchers to access and analyze raw sequencing data for autoimmune disease research.
The SRA les can be downloaded using the SRA Toolkit, a set of command-line utilities provided
by the NCBI for retrieving and processing sequencing data. The SRA Toolkit can be downloaded
and installed from the ofcial NCBI website, where versions are available for different operating
systems, including Windows, macOS, and Linux. After installation, the toolkit provides various

109 Bioinformatics Databases
commands for interacting with SRA data, enabling users to efciently download sequencing reads
in a format suitable for downstream analysis.
One of the most commonly used commands in the SRA Toolkit is fastq-dum p and fasterq-
dump. The latter is optimized for speed and efciency when converting SRA les into FASTQ
format. To download an SRA le from the SRA database, users need to provide the unique SRA
accession number associated with the sequencing data. The following command can be executed
in the terminal:
fasterq-dump SRRXXXXXXX
where SRRXXXXXXX should be replaced with the actual SRA accession number. By default,
fasterq-dump will download the le to the current working directory. To improve performance
and avoid disk space limitations, users can specify a temporary directory for intermediate les
using the --te mp option:
fasterq-dump --temp /path/to/temp/dir SRRXXXXXXX
Additionally, users may want to enable multithreading for faster processing by adding the
--threads option:
fasterq-dump --threads 4 SRRXXXXXXX
where 4 represents the number of CPU threads to be utilized.
4.2.1.1.7 BED Fo rmat
BED (Browser Extensible Data) format is a tab-delimited text format used to represent genomic features or interval data, such as gene locations, SNP positions, and chromatin interaction sites. Each
line in a BED le consists of elds specifying the chromosome, start and end coordinates, feature
name, score, and strand orientation. Indexed elds in BED format include genomic coordinates,
regulatory element annotations, and conservation scores.
A standard BED le has at least three required elds and can include up to 12 optional elds:
1. chrom: Name of the chromosome (e.g., chr1, chrX).
2. chromStart: The starting position of the feature in the chromosome (0-based).
3. chromEnd: The ending position of the feature (not inclusive, i.e., 1-based). Optional elds
(up to eld 12).
4. name: Name of the feature (e.g., gene name).
5. score: Score between 0 and 1000 (used for visualization).
6. strand: Strand: + or −.
7. thickStart: Start position where feature is drawn thick (e.g., start of coding region).
8. thickEnd: End position for thick part of feature.
9. itemRgb: RGB value for display color (e.g., 255,0,0 for red).
10. blockCount: Number of blocks (exons).
11. blockSizes: Comma-separated list of block sizes.
12. blockStarts: Comma-separated list of block start positions relative to chromStart.
BED les are frequently retrieved from GenBank, RefSeq, and GEO databases. The following
are some uses:
• Genome Browsers: BED les are commonly used to display gene models, alignments, or
annotations on browsers like UCSC, IGV, and Ensembl.
• Interval-Based analysis: Tools like BEDTools, BEDOPS, and IntersectBed use BED les
to perform operations like intersection, subtraction, and merging of genomic intervals.

110 Bioinformatics of Autoimmune Diseases
• Peak Calling: In ChIP-Seq and ATAC-Seq, BED les represent called peaks or enriched
regions.
• Transcript Annotation: BED12 format is particularly useful to describe exon–intron struc-
tures of transcripts.
• Custom Annotations: Researchers often use BED les to annotate SNPs, enhancers, or
other regulatory elements for downstream analysis.
4.2.1.1.8 SAM/BAM Fo rmat
SAM (Sequence Alignment/Map) and BAM (Binary Alignment/Map) les are standard formats
used in bioinformatics for storing sequence alignment data (Figure 4.1). The SAM format is a plain
text, tab-delimited le that records information about how sequencing reads align to a reference
genome. It contains a header section, which includes metadata such as the reference genome used,
and an alignment section, where each line represents a mapped or unmapped read along with details
such as the read name, mapping position, mapping quality, and alignment score. The SAM format is
exible and human-readable, making it useful for debugging and manual inspection.
BAM les, on the other hand, are the binary equivalent of SAM les. They store the same
alignment information but in a compressed and indexed format that allows for efcient storage and
retrieval. BAM les are signicantly smaller than their SAM counterparts, making them ideal for
handling large datasets generated by NGS technologies. Since they are binary, they require specialized tools such as Samtools to be viewed and manipulated. One of the key advantages of BAM
les is that they can be indexed, enabling rapid random access to specic regions of the genome
without having to scan the entire le.
Both SAM and BAM les are widely used in bioinformatics workows, particularly in variant
calling, transcriptomics, and comparative genomics. They allow researchers to analyze sequencing
data efciently, whether by ltering reads based on mapping quality, identifying structural variations, or extracting aligned sequences for further study. The ability to convert between SAM and
BAM formats ensures exibility, with BAM les being preferred for storage and computation while
SAM les remain useful for human interpretation and debugging.
Explanation of key elds in SAM/BAM:
1. QNAME: Query name (e.g., read001)
2. FL AG: Bitwise ag indicating read properties (e.g., paired, mapped)
3. RNAME: Reference sequence name (e.g., chr1)
4. POS: 1-based position of alignment
5. MAPQ: Mapping quality score
6. CIGAR: Compact representation of alignment (e.g., 76M = 76 matches)
7. RNEXT: Reference name of the mate read
8. PNEXT: Position of the mate read
9. TLEN: Observed template length
10. SEQ: Read sequence
11. QUAL: Quality string (ASCII-encoded Phred scores)
FIGURE 4.1 SAM/BAM le format.

111 Bioinformatics Databases
4.2.1.1.9 Variant Call Format
Variant Call Format (VCF) is a widely used le format in bioinformatics for storing genetic variation data. It provides a standardized way to represent SNPs, insertions, deletions, and structural
variations detected in DNA sequencing data. VCF les are designed to be both human-readable and
machine-readable, making them a fundamental component of genomic analysis. The format was
developed as part of the 1000 Genomes Project and has since become the standard for representing
and sharing variant data.
A VCF le (Figure 4.2) consists of two main sections: the header and the body. The header
contains metadata lines prexed with “##” that describe the le contents, including information
about reference genomes, ltering criteria, and annotation details. The last header line, starting with
a single “#”, denes column names for the data section. The body contains tab-separated records
where each row represents a single variant, including its genomic position, reference and alternate
alleles, quality scores, and additional information about genotypes across different samples.
Each record in the VCF le includes key elds such as the chromosome, position, and reference
allele, along with the observed alternate allele(s). Additional elds provide details on the quality
and condence of variant calls, with optional annotation elds that can include information on
gene impact, zygosity, and allele frequencies. The genotype information for each sample is often
included, representing whether an individual is homozygous or heterozygous for a particular variant.
The following are the column name and denition:
1. CHROM: Chromosome name (e.g., chr1)
2. POS: Position on the chromosome (1-based)
3. ID: Variant ID if found (e.g., from dbSNP)
4. REF: Reference allele in the specied position
5. ALT: Alternate allele(s) of the sample in the specied position
6. QUAL: Quality score of the variant
7. FILTER: Filter status is applied (e.g., PASS or LowQual)
8. INFO: Additional information (e.g., DP=30 means depth of 30)
9. FORMAT: Format of sample elds (e.g., GT = genotype)
10. SAMPLE: One or more columns with sample-specic data
VCF les can be compressed and indexed using bgzip and tabix, enabling efcient storage
and retrieval of large datasets. The format is highly exible and allows for extensive annotations,
making it suitable for various applications in genomics, from population genetics to clinical variant
interpretation. Many bioinformatics tools, such as bcftools and GATK, support VCF processing,
allowing researchers to lter, annotate, and analyze genetic variations with ease.
FIGURE 4.2 Variant Call Format (VCF).

112 Bioinformatics of Autoimmune Diseases
4.2.1.2 NCBI Entrez E-Utilities
NCBI E-utilities are a set of API tools provided by the NCBI that allow users to programmatically access and retrieve data from various NCBI databases. The NCBI Entrez system encompasses
38 databases accessible via the E-utilities API. These databases cover a broad spectrum of biomedical data, including nucleotide and protein sequences, gene records, 3D molecular structures,
and biomedical literature. The E-utilities enable automation of tasks such as searching for articles
in PubMed, fetching DNA sequences from GenBank, and obtaining protein structures from the
Protein Data Bank (PDB). By sending HTTP requests with specic parameters, users can interact
with NCBI’s vast repository of biological and biomedical data without needing to manually navigate the web interface. Each utility within the E-utilities suite serves a specic purpose, such as
esearch for querying databases, efetch for retrieving full records, elink for nding related
data, and esummary for obtaining concise summaries.
The output formats of NCBI E-utilities vary depending on the utility used and the nature of the
retrieved data. Many E-utilities support structured formats such as XML and JSON, which facilitate
parsing and integration into computational workows. XML is widely used for detailed, hierarchical representations of data, making it suitable for processing large datasets with complex relationships. JSON, on the other hand, provides a more lightweight and readable format, often preferred
for web applications and scripting. In some cases, plain text and other specialized formats such as
FASTA or ASN.1 are available, particularly for sequence data from databases like GenBank and
RefSeq. Users can specify the desired format in their API requests, allowing for exibility in how
they handle and analyze the retrieved information.
NCBI E-utilities can be accessed from within Python using the requests library, which allows
users to send HTTP requests and retrieve data in various formats. By constructing appropriate
query URLs, Python scripts can interact with NCBI databases programmatically. For example, to
search for a specic gene in GenBank, users can send an esearch request with relevant parameters, receive a list of matching IDs, and then use efetch to download detailed records. This
approach enables efcient automation of tasks such as literature searches, sequence retrieval, and
metadata extraction.
A typical workow involves rst importing the requests library, constructing the base URL with
the desired utility and parameters, sending a request, and then parsing the response. If XML or JSON
output is specied, the response can be processed using Python’s xml.etree.ElementTree
or json module, respectively. For sequence data, if the response is in FASTA format, it can be
parsed using the Biopython library, which provides extensive tools for handling biological data.
Biopython’s Entrez module simplies interaction with NCBI’s E-utilities by offering functions like
Entrez.esearch() and E ntr e z.e fe t ch(), which abstract the URL construction and HTTP
request handling, making data retrieval more streamlined and user-friendly.
By leveraging Python’s capabilities, researchers can integrate NCBI data retrieval into larger
bioinformatics pipelines, enabling large-scale analysis and automation. This is particularly useful
for applications such as genome annotation, evolutionary studies, and protein structure prediction,
where retrieving and processing large amounts of biological data efciently is essential.
NCBI E-utilities can also be accessed through the command line, allowing users to interact with
NCBI databases without requiring a web browser or a programming environment. By using tools
like curl or wget, users can send HTTP requests directly from a terminal and retrieve data in
various formats. This is particularly useful for scripting automated workows, where large-scale
queries or batch processing of biological data are required.
In addition to direct command-line access, E-utilities are structured as RESTful APIs, meaning
that they follow REST (Representational State Transfer) principles, making them easily accessible
via HTTP requests from web applications, scripts, or third-party tools. Each utility is designed as an
endpoint that accepts specic parameters through URL queries, returning data in formats such as
XML, JSON, FASTA, or ASN.1. The RESTful nature of E-utilities makes them highly exible and

113 Bioinformatics Databases
interoperable with various programming languages, including Python, R, and Java. Researchers can
integrate these API calls into web applications, bioinformatics pipelines, or cloud-based workows,
facilitating large-scale data retrieval and analysis in a seamless and automated manner.
NCBI E-utilities can also be accessed through Entrez Direct (EDirect), a command-line interface
that provides a streamlined way to query and retrieve data from NCBI databases. EDirect is particularly useful for users who work in Unix-based environments and need to automate large-scale
data retrieval without writing extensive scripts. It allows for complex queries by chaining multiple
E-utilities commands, making it a powerful tool for bioinformatics workows. EDirect is installed
via the EDirect package, which can be set up on Linux or macOS using a simple installation script
provided by NCBI. One of the advantages of EDirect is its ability to handle large datasets efciently,
supporting pagination and ltering options. It also integrates well with Unix utilities such as grep,
awk, and sed, enabling more advanced processing and extraction of relevant information directly
from the command line.
By combining EDirect with Python scripts, RESTful API calls, or standard E-utilities commands, researchers can build exible and automated pipelines for retrieving and analyzing biological data. The versatility of EDirect makes it an essential tool for bioinformaticians working on
large-scale genomic, proteomic, or bibliographic studies, reducing the need for manual web-based
searches and signicantly improving workow efciency.
In this section, we will use E-utilities from Biopython, which is a powerful open-source library
designed to facilitate computational biology tasks using Python. It provides tools for processing
biological data, such as sequences, structures, and alignments, making it an essential resource for
bioinformatics research. The library supports a wide range of le formats, allowing users to read and
write sequence data in formats such as FASTA, GenBank, and PDB. In addition, Biopython offers
functionalities for sequence manipulation, annotation handling, and working with phylogenetic
trees. It is widely used in genomic and proteomic analyses, where efcient handling of biological
data is necessary. The integration of Biopython with other bioinformatics tools and databases allows
researchers to automate complex workows, reducing the time and effort needed for data processing.
One of the most valuable features of Biopython is its interface with online biological databases,
particularly through the Entrez module, which provides access to the NCBI resources. This module enables users to retrieve and search data from these databases such as GenBank, PubMed, and
PDB. Through a structured approach, users can query nucleotide and protein sequences, retrieve
scientic publications, and download genomic annotations directly into their Python scripts. By
automating queries to NCBI databases, researchers can efciently gather large datasets without
manually navigating web interfaces. This capability is crucial for large-scale bioinformatics projects that require extensive data mining and retrieval, making the Entrez module an indispensable
tool for computational biology applications.
Table 4.2 presents the NCBI databases most commonly used to search for and retrieve data rel-
evant to autoimmune diseases.
In the following examples, we will use Biopython’s Entrez module to fetch data from NCBI databases. To run these examples, you need Python with the Biopython module installed. If Biopython
is not installed, you may need to install it using
pip install biopython
Before running the examples, ensure that you have an active internet connection, as Entrez
requires access to NCBI’s online services.
4.2.1.2.1 Fetching Autoimmune Disease-Linked Gene Data
In this example, we will use the name of an autoimmune disease to retrieve basic information
about the genes associated with that disease in humans. Before running the script, you may need to
replace the email address with your own and specify a disease name and an output le where the
data will be saved.
Соседние файлы в папке Библиотека им академика М.И. Перельмана
