tooluniverse 0.1.4__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tooluniverse might be problematic. Click here for more details.
- tooluniverse/__init__.py +340 -4
- tooluniverse/admetai_tool.py +84 -0
- tooluniverse/agentic_tool.py +563 -0
- tooluniverse/alphafold_tool.py +96 -0
- tooluniverse/base_tool.py +129 -6
- tooluniverse/boltz_tool.py +207 -0
- tooluniverse/chem_tool.py +192 -0
- tooluniverse/compose_scripts/__init__.py +1 -0
- tooluniverse/compose_scripts/biomarker_discovery.py +293 -0
- tooluniverse/compose_scripts/comprehensive_drug_discovery.py +186 -0
- tooluniverse/compose_scripts/drug_safety_analyzer.py +89 -0
- tooluniverse/compose_scripts/literature_tool.py +34 -0
- tooluniverse/compose_scripts/output_summarizer.py +279 -0
- tooluniverse/compose_scripts/tool_description_optimizer.py +681 -0
- tooluniverse/compose_scripts/tool_discover.py +705 -0
- tooluniverse/compose_scripts/tool_graph_composer.py +448 -0
- tooluniverse/compose_tool.py +371 -0
- tooluniverse/ctg_tool.py +1002 -0
- tooluniverse/custom_tool.py +81 -0
- tooluniverse/dailymed_tool.py +108 -0
- tooluniverse/data/admetai_tools.json +155 -0
- tooluniverse/data/agentic_tools.json +1156 -0
- tooluniverse/data/alphafold_tools.json +87 -0
- tooluniverse/data/boltz_tools.json +9 -0
- tooluniverse/data/chembl_tools.json +16 -0
- tooluniverse/data/clait_tools.json +108 -0
- tooluniverse/data/clinicaltrials_gov_tools.json +326 -0
- tooluniverse/data/compose_tools.json +202 -0
- tooluniverse/data/dailymed_tools.json +70 -0
- tooluniverse/data/dataset_tools.json +646 -0
- tooluniverse/data/disease_target_score_tools.json +712 -0
- tooluniverse/data/efo_tools.json +17 -0
- tooluniverse/data/embedding_tools.json +319 -0
- tooluniverse/data/enrichr_tools.json +31 -0
- tooluniverse/data/europe_pmc_tools.json +22 -0
- tooluniverse/data/expert_feedback_tools.json +10 -0
- tooluniverse/data/fda_drug_adverse_event_tools.json +491 -0
- tooluniverse/data/fda_drug_labeling_tools.json +544 -168
- tooluniverse/data/fda_drugs_with_brand_generic_names_for_tool.py +76929 -148860
- tooluniverse/data/finder_tools.json +209 -0
- tooluniverse/data/gene_ontology_tools.json +113 -0
- tooluniverse/data/gwas_tools.json +1082 -0
- tooluniverse/data/hpa_tools.json +333 -0
- tooluniverse/data/humanbase_tools.json +47 -0
- tooluniverse/data/idmap_tools.json +74 -0
- tooluniverse/data/mcp_client_tools_example.json +113 -0
- tooluniverse/data/mcpautoloadertool_defaults.json +28 -0
- tooluniverse/data/medlineplus_tools.json +141 -0
- tooluniverse/data/monarch_tools.json +1 -1
- tooluniverse/data/openalex_tools.json +36 -0
- tooluniverse/data/opentarget_tools.json +82 -58
- tooluniverse/data/output_summarization_tools.json +101 -0
- tooluniverse/data/packages/bioinformatics_core_tools.json +1756 -0
- tooluniverse/data/packages/categorized_tools.txt +206 -0
- tooluniverse/data/packages/cheminformatics_tools.json +347 -0
- tooluniverse/data/packages/earth_sciences_tools.json +74 -0
- tooluniverse/data/packages/genomics_tools.json +776 -0
- tooluniverse/data/packages/image_processing_tools.json +38 -0
- tooluniverse/data/packages/machine_learning_tools.json +789 -0
- tooluniverse/data/packages/neuroscience_tools.json +62 -0
- tooluniverse/data/packages/original_tools.txt +0 -0
- tooluniverse/data/packages/physics_astronomy_tools.json +62 -0
- tooluniverse/data/packages/scientific_computing_tools.json +560 -0
- tooluniverse/data/packages/single_cell_tools.json +453 -0
- tooluniverse/data/packages/software_tools.json +4954 -0
- tooluniverse/data/packages/structural_biology_tools.json +396 -0
- tooluniverse/data/packages/visualization_tools.json +399 -0
- tooluniverse/data/pubchem_tools.json +215 -0
- tooluniverse/data/pubtator_tools.json +68 -0
- tooluniverse/data/rcsb_pdb_tools.json +1332 -0
- tooluniverse/data/reactome_tools.json +19 -0
- tooluniverse/data/semantic_scholar_tools.json +26 -0
- tooluniverse/data/special_tools.json +2 -25
- tooluniverse/data/tool_composition_tools.json +88 -0
- tooluniverse/data/toolfinderkeyword_defaults.json +34 -0
- tooluniverse/data/txagent_client_tools.json +9 -0
- tooluniverse/data/uniprot_tools.json +211 -0
- tooluniverse/data/url_fetch_tools.json +94 -0
- tooluniverse/data/uspto_downloader_tools.json +9 -0
- tooluniverse/data/uspto_tools.json +811 -0
- tooluniverse/data/xml_tools.json +3275 -0
- tooluniverse/dataset_tool.py +296 -0
- tooluniverse/default_config.py +165 -0
- tooluniverse/efo_tool.py +42 -0
- tooluniverse/embedding_database.py +630 -0
- tooluniverse/embedding_sync.py +396 -0
- tooluniverse/enrichr_tool.py +266 -0
- tooluniverse/europe_pmc_tool.py +52 -0
- tooluniverse/execute_function.py +1775 -95
- tooluniverse/extended_hooks.py +444 -0
- tooluniverse/gene_ontology_tool.py +194 -0
- tooluniverse/graphql_tool.py +158 -36
- tooluniverse/gwas_tool.py +358 -0
- tooluniverse/hpa_tool.py +1645 -0
- tooluniverse/humanbase_tool.py +389 -0
- tooluniverse/logging_config.py +254 -0
- tooluniverse/mcp_client_tool.py +764 -0
- tooluniverse/mcp_integration.py +413 -0
- tooluniverse/mcp_tool_registry.py +925 -0
- tooluniverse/medlineplus_tool.py +337 -0
- tooluniverse/openalex_tool.py +228 -0
- tooluniverse/openfda_adv_tool.py +283 -0
- tooluniverse/openfda_tool.py +393 -160
- tooluniverse/output_hook.py +1122 -0
- tooluniverse/package_tool.py +195 -0
- tooluniverse/pubchem_tool.py +158 -0
- tooluniverse/pubtator_tool.py +168 -0
- tooluniverse/rcsb_pdb_tool.py +38 -0
- tooluniverse/reactome_tool.py +108 -0
- tooluniverse/remote/boltz/boltz_mcp_server.py +50 -0
- tooluniverse/remote/depmap_24q2/depmap_24q2_mcp_tool.py +442 -0
- tooluniverse/remote/expert_feedback/human_expert_mcp_tools.py +2013 -0
- tooluniverse/remote/expert_feedback/simple_test.py +23 -0
- tooluniverse/remote/expert_feedback/start_web_interface.py +188 -0
- tooluniverse/remote/expert_feedback/web_only_interface.py +0 -0
- tooluniverse/remote/expert_feedback_mcp/human_expert_mcp_server.py +1611 -0
- tooluniverse/remote/expert_feedback_mcp/simple_test.py +34 -0
- tooluniverse/remote/expert_feedback_mcp/start_web_interface.py +91 -0
- tooluniverse/remote/immune_compass/compass_tool.py +327 -0
- tooluniverse/remote/pinnacle/pinnacle_tool.py +328 -0
- tooluniverse/remote/transcriptformer/transcriptformer_tool.py +586 -0
- tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +61 -0
- tooluniverse/remote/uspto_downloader/uspto_downloader_tool.py +120 -0
- tooluniverse/remote_tool.py +99 -0
- tooluniverse/restful_tool.py +53 -30
- tooluniverse/scripts/generate_tool_graph.py +408 -0
- tooluniverse/scripts/visualize_tool_graph.py +829 -0
- tooluniverse/semantic_scholar_tool.py +62 -0
- tooluniverse/smcp.py +2452 -0
- tooluniverse/smcp_server.py +975 -0
- tooluniverse/test/mcp_server_test.py +0 -0
- tooluniverse/test/test_admetai_tool.py +370 -0
- tooluniverse/test/test_agentic_tool.py +129 -0
- tooluniverse/test/test_alphafold_tool.py +71 -0
- tooluniverse/test/test_chem_tool.py +37 -0
- tooluniverse/test/test_compose_lieraturereview.py +63 -0
- tooluniverse/test/test_compose_tool.py +448 -0
- tooluniverse/test/test_dailymed.py +69 -0
- tooluniverse/test/test_dataset_tool.py +200 -0
- tooluniverse/test/test_disease_target_score.py +56 -0
- tooluniverse/test/test_drugbank_filter_examples.py +179 -0
- tooluniverse/test/test_efo.py +31 -0
- tooluniverse/test/test_enrichr_tool.py +21 -0
- tooluniverse/test/test_europe_pmc_tool.py +20 -0
- tooluniverse/test/test_fda_adv.py +95 -0
- tooluniverse/test/test_fda_drug_labeling.py +91 -0
- tooluniverse/test/test_gene_ontology_tools.py +66 -0
- tooluniverse/test/test_gwas_tool.py +139 -0
- tooluniverse/test/test_hpa.py +625 -0
- tooluniverse/test/test_humanbase_tool.py +20 -0
- tooluniverse/test/test_idmap_tools.py +61 -0
- tooluniverse/test/test_mcp_server.py +211 -0
- tooluniverse/test/test_mcp_tool.py +247 -0
- tooluniverse/test/test_medlineplus.py +220 -0
- tooluniverse/test/test_openalex_tool.py +32 -0
- tooluniverse/test/test_opentargets.py +28 -0
- tooluniverse/test/test_pubchem_tool.py +116 -0
- tooluniverse/test/test_pubtator_tool.py +37 -0
- tooluniverse/test/test_rcsb_pdb_tool.py +86 -0
- tooluniverse/test/test_reactome.py +54 -0
- tooluniverse/test/test_semantic_scholar_tool.py +24 -0
- tooluniverse/test/test_software_tools.py +147 -0
- tooluniverse/test/test_tool_description_optimizer.py +49 -0
- tooluniverse/test/test_tool_finder.py +26 -0
- tooluniverse/test/test_tool_finder_llm.py +252 -0
- tooluniverse/test/test_tools_find.py +195 -0
- tooluniverse/test/test_uniprot_tools.py +74 -0
- tooluniverse/test/test_uspto_tool.py +72 -0
- tooluniverse/test/test_xml_tool.py +113 -0
- tooluniverse/tool_finder_embedding.py +267 -0
- tooluniverse/tool_finder_keyword.py +693 -0
- tooluniverse/tool_finder_llm.py +699 -0
- tooluniverse/tool_graph_web_ui.py +955 -0
- tooluniverse/tool_registry.py +416 -0
- tooluniverse/uniprot_tool.py +155 -0
- tooluniverse/url_tool.py +253 -0
- tooluniverse/uspto_tool.py +240 -0
- tooluniverse/utils.py +369 -41
- tooluniverse/xml_tool.py +369 -0
- tooluniverse-1.0.0.dist-info/METADATA +377 -0
- tooluniverse-1.0.0.dist-info/RECORD +186 -0
- {tooluniverse-0.1.4.dist-info → tooluniverse-1.0.0.dist-info}/WHEEL +1 -1
- tooluniverse-1.0.0.dist-info/entry_points.txt +9 -0
- tooluniverse-0.1.4.dist-info/METADATA +0 -141
- tooluniverse-0.1.4.dist-info/RECORD +0 -18
- {tooluniverse-0.1.4.dist-info → tooluniverse-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-0.1.4.dist-info → tooluniverse-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,1756 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "PackageTool",
|
|
4
|
+
"name": "get_biopython_info",
|
|
5
|
+
"description": "Get comprehensive information about Biopython – powerful tools for computational molecular biology and bioinformatics",
|
|
6
|
+
"parameter": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"include_examples": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
12
|
+
"default": true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"package_name": "biopython",
|
|
17
|
+
"local_info": {
|
|
18
|
+
"name": "Biopython",
|
|
19
|
+
"description": "Freely available Python tools for computational molecular biology. Provides a wide range of bioinformatics functionality including sequence analysis, phylogenetics, structure analysis, and database access.",
|
|
20
|
+
"category": "Bioinformatics",
|
|
21
|
+
"import_name": "Bio",
|
|
22
|
+
"popularity": 92,
|
|
23
|
+
"keywords": [
|
|
24
|
+
"bioinformatics",
|
|
25
|
+
"sequence analysis",
|
|
26
|
+
"phylogenetics",
|
|
27
|
+
"structure analysis",
|
|
28
|
+
"database access"
|
|
29
|
+
],
|
|
30
|
+
"documentation": "https://biopython.org/docs/latest/",
|
|
31
|
+
"repository": "https://github.com/biopython/biopython",
|
|
32
|
+
"installation": {
|
|
33
|
+
"pip": "pip install biopython",
|
|
34
|
+
"conda": "conda install -c conda-forge biopython"
|
|
35
|
+
},
|
|
36
|
+
"usage_example": "from Bio.Seq import Seq\nfrom Bio import SeqIO\nfrom Bio.SeqUtils import GC\n\n# Create and analyze a DNA sequence\ndna_seq = Seq('AGTACACTGGT')\nprint(f'Length: {len(dna_seq)}')\nprint(f'GC content: {GC(dna_seq):.1f}%')\nprint(f'Translation: {dna_seq.translate()}')\n\n# Read sequences from FASTA\nfor record in SeqIO.parse('example.fasta', 'fasta'):\n print(f'{record.id}: {len(record.seq)} bp')",
|
|
37
|
+
"quick_start": [
|
|
38
|
+
"Install: pip install biopython",
|
|
39
|
+
"Import: from Bio.Seq import Seq, from Bio import SeqIO",
|
|
40
|
+
"Create sequence: seq = Seq('ATCG')",
|
|
41
|
+
"Analyze: GC content, translation, complement",
|
|
42
|
+
"File I/O: SeqIO.parse() for FASTA/GenBank files"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "PackageTool",
|
|
48
|
+
"name": "get_scikit_bio_info",
|
|
49
|
+
"description": "Get comprehensive information about scikit-bio – bioinformatics library built on scientific Python stack",
|
|
50
|
+
"parameter": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"include_examples": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
56
|
+
"default": true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"package_name": "scikit-bio",
|
|
61
|
+
"local_info": {
|
|
62
|
+
"name": "scikit-bio",
|
|
63
|
+
"description": "Open-source Python library providing data structures, algorithms, and educational resources for bioinformatics. Built on the scientific Python stack for efficient computation.",
|
|
64
|
+
"category": "Bioinformatics",
|
|
65
|
+
"import_name": "skbio",
|
|
66
|
+
"popularity": 75,
|
|
67
|
+
"keywords": [
|
|
68
|
+
"bioinformatics",
|
|
69
|
+
"phylogenetics",
|
|
70
|
+
"sequence analysis",
|
|
71
|
+
"diversity analysis",
|
|
72
|
+
"scientific computing"
|
|
73
|
+
],
|
|
74
|
+
"documentation": "http://scikit-bio.org/",
|
|
75
|
+
"repository": "https://github.com/biocore/scikit-bio",
|
|
76
|
+
"installation": {
|
|
77
|
+
"pip": "pip install scikit-bio",
|
|
78
|
+
"conda": "conda install -c conda-forge scikit-bio"
|
|
79
|
+
},
|
|
80
|
+
"usage_example": "import skbio\nfrom skbio import DNA\nfrom skbio.alignment import local_pairwise_align_ssw\n\n# Create DNA sequences\nseq1 = DNA('ACCGGTGGAACCGGTAACACCCAC')\nseq2 = DNA('ACCGGTAACAC')\n\n# Perform alignment\nalignment = local_pairwise_align_ssw(seq1, seq2)\nprint(alignment)\n\n# Calculate sequence statistics\nprint(f'GC content: {seq1.gc_content():.2f}')\nprint(f'Complement: {seq1.complement()}')",
|
|
81
|
+
"quick_start": [
|
|
82
|
+
"Install: pip install scikit-bio",
|
|
83
|
+
"Import: import skbio, from skbio import DNA",
|
|
84
|
+
"Create sequences: DNA('ATCG')",
|
|
85
|
+
"Alignment: local_pairwise_align_ssw()",
|
|
86
|
+
"Analysis: GC content, diversity metrics"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "PackageTool",
|
|
92
|
+
"name": "get_biotite_info",
|
|
93
|
+
"description": "Get comprehensive information about Biotite – comprehensive computational molecular biology library",
|
|
94
|
+
"parameter": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"properties": {
|
|
97
|
+
"include_examples": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
100
|
+
"default": true
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"package_name": "biotite",
|
|
105
|
+
"local_info": {
|
|
106
|
+
"name": "Biotite",
|
|
107
|
+
"description": "Swiss army knife for bioinformatics. Comprehensive library for computational molecular biology including sequence analysis, structure analysis, database access, and visualization with NumPy-based performance.",
|
|
108
|
+
"category": "Structural Biology",
|
|
109
|
+
"import_name": "biotite",
|
|
110
|
+
"popularity": 70,
|
|
111
|
+
"keywords": [
|
|
112
|
+
"structural biology",
|
|
113
|
+
"sequence analysis",
|
|
114
|
+
"protein structure",
|
|
115
|
+
"molecular biology",
|
|
116
|
+
"bioinformatics"
|
|
117
|
+
],
|
|
118
|
+
"documentation": "https://www.biotite-python.org/",
|
|
119
|
+
"repository": "https://github.com/biotite-dev/biotite",
|
|
120
|
+
"installation": {
|
|
121
|
+
"pip": "pip install biotite",
|
|
122
|
+
"conda": "conda install -c conda-forge biotite"
|
|
123
|
+
},
|
|
124
|
+
"usage_example": "import biotite.sequence as seq\nimport biotite.sequence.align as align\nimport biotite.database.entrez as entrez\n\n# Create and align sequences\nseq1 = seq.ProteinSequence('MVHLPEWHTDFGKNLMVILQLLLQQL')\nseq2 = seq.ProteinSequence('MVHLPEWHTDFGKGQMVAQVILLQQL')\n\n# Perform alignment\nmatrix = align.SubstitutionMatrix.std_protein_matrix()\nalignments = align.align_optimal(seq1, seq2, matrix)\nprint(alignments[0])",
|
|
125
|
+
"quick_start": [
|
|
126
|
+
"Install: pip install biotite",
|
|
127
|
+
"Import modules: import biotite.sequence as seq",
|
|
128
|
+
"Create sequences: seq.ProteinSequence('MVHL...')",
|
|
129
|
+
"Analyze structures: load PDB, calculate contacts",
|
|
130
|
+
"Access databases: Entrez, PDB downloads"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"type": "PackageTool",
|
|
136
|
+
"name": "get_gget_info",
|
|
137
|
+
"description": "Get comprehensive information about gget – genomics command-line tool and Python package",
|
|
138
|
+
"parameter": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"properties": {
|
|
141
|
+
"include_examples": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
144
|
+
"default": true
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"package_name": "gget",
|
|
149
|
+
"local_info": {
|
|
150
|
+
"name": "gget",
|
|
151
|
+
"description": "Command-line tool and Python package for efficient querying of genomic databases. Enables quick access to gene information, sequences, and annotations from major genomics resources.",
|
|
152
|
+
"category": "Genomics Databases",
|
|
153
|
+
"import_name": "gget",
|
|
154
|
+
"popularity": 70,
|
|
155
|
+
"keywords": [
|
|
156
|
+
"genomics databases",
|
|
157
|
+
"gene information",
|
|
158
|
+
"ENSEMBL",
|
|
159
|
+
"sequence retrieval",
|
|
160
|
+
"annotations"
|
|
161
|
+
],
|
|
162
|
+
"documentation": "https://github.com/pachterlab/gget",
|
|
163
|
+
"repository": "https://github.com/pachterlab/gget",
|
|
164
|
+
"installation": {
|
|
165
|
+
"pip": "pip install gget",
|
|
166
|
+
"conda": "conda install -c bioconda gget"
|
|
167
|
+
},
|
|
168
|
+
"usage_example": "import gget\n\n# Search for genes\nresults = gget.search('BRCA1')\nprint(results.head())\n\n# Get gene information\ninfo = gget.info('ENSG00000012048')\nprint(info)\n\n# Fetch sequences\nseq = gget.seq('ENSG00000012048', seqtype='transcript')\nprint(seq)",
|
|
169
|
+
"quick_start": [
|
|
170
|
+
"Install: pip install gget",
|
|
171
|
+
"Search genes: gget.search('BRCA1')",
|
|
172
|
+
"Gene info: gget.info('ENSG00000012048')",
|
|
173
|
+
"Get sequences: gget.seq(gene_id, seqtype='transcript')",
|
|
174
|
+
"Access databases: ENSEMBL, UniProt, PDB"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"type": "PackageTool",
|
|
180
|
+
"name": "get_trackpy_info",
|
|
181
|
+
"description": "Get comprehensive information about trackpy – particle tracking toolkit for Python",
|
|
182
|
+
"parameter": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"properties": {
|
|
185
|
+
"info_type": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"enum": [
|
|
188
|
+
"overview",
|
|
189
|
+
"installation",
|
|
190
|
+
"usage",
|
|
191
|
+
"documentation"
|
|
192
|
+
],
|
|
193
|
+
"description": "Type of information to retrieve about trackpy"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"required": [
|
|
197
|
+
"info_type"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"package_name": "trackpy",
|
|
201
|
+
"local_info": {
|
|
202
|
+
"name": "trackpy",
|
|
203
|
+
"description": "Python package for particle tracking in 2D, 3D, and higher dimensions. Provides feature detection, linking trajectories over time, and motion analysis for applications in biophysics and materials science.",
|
|
204
|
+
"category": "Image Analysis / Particle Tracking",
|
|
205
|
+
"import_name": "trackpy",
|
|
206
|
+
"popularity": 68,
|
|
207
|
+
"keywords": [
|
|
208
|
+
"particle tracking",
|
|
209
|
+
"trajectory analysis",
|
|
210
|
+
"microscopy",
|
|
211
|
+
"biophysics",
|
|
212
|
+
"motion analysis"
|
|
213
|
+
],
|
|
214
|
+
"documentation": "http://soft-matter.github.io/trackpy/",
|
|
215
|
+
"repository": "https://github.com/soft-matter/trackpy",
|
|
216
|
+
"installation": {
|
|
217
|
+
"pip": "pip install trackpy",
|
|
218
|
+
"conda": "conda install -c conda-forge trackpy"
|
|
219
|
+
},
|
|
220
|
+
"usage_example": "import trackpy as tp\nimport pandas as pd\nimport numpy as np\nfrom skimage import data\n\n# Load sample images (normally from microscopy)\nframes = [data.coins() for _ in range(5)] # Mock time series\n\n# Locate particles in each frame\nf = []\nfor i, frame in enumerate(frames):\n features = tp.locate(frame, diameter=15, minmass=1000)\n features['frame'] = i\n f.append(features)\n\nfeatures = pd.concat(f, ignore_index=True)\n\n# Link particles into trajectories\ntrajectories = tp.link(features, search_range=20, memory=3)\n\nprint(f'Found {len(trajectories)} particle detections')\nprint(f'Unique particles: {trajectories[\"particle\"].nunique()}')\n\n# Filter out short trajectories\nfiltered = tp.filter_stubs(trajectories, threshold=3)\nprint(f'After filtering: {len(filtered)} detections')\n\n# Calculate motion statistics\nmotion = tp.motion.msd(filtered, mpp=0.1, fps=10)\nprint(motion.head())",
|
|
221
|
+
"quick_start": [
|
|
222
|
+
"Install: pip install trackpy",
|
|
223
|
+
"Locate particles: tp.locate(image, diameter=15)",
|
|
224
|
+
"Link trajectories: tp.link(features, search_range=20)",
|
|
225
|
+
"Filter trajectories: tp.filter_stubs(tracks, threshold=3)",
|
|
226
|
+
"Analyze motion: tp.motion.msd(tracks)",
|
|
227
|
+
"Visualize: tp.plot_traj(tracks)"
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"type": "PackageTool",
|
|
233
|
+
"name": "get_numba_info",
|
|
234
|
+
"description": "Get comprehensive information about Numba – JIT compiler for Python",
|
|
235
|
+
"parameter": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"info_type": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"enum": [
|
|
241
|
+
"overview",
|
|
242
|
+
"installation",
|
|
243
|
+
"usage",
|
|
244
|
+
"documentation"
|
|
245
|
+
],
|
|
246
|
+
"description": "Type of information to retrieve about Numba"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"required": [
|
|
250
|
+
"info_type"
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
"package_name": "numba",
|
|
254
|
+
"local_info": {
|
|
255
|
+
"name": "Numba",
|
|
256
|
+
"description": "Open source JIT compiler that translates a subset of Python and NumPy code into fast machine code. Provides significant speedups for numerical computations with minimal code changes.",
|
|
257
|
+
"category": "Performance / JIT Compilation",
|
|
258
|
+
"import_name": "numba",
|
|
259
|
+
"popularity": 87,
|
|
260
|
+
"keywords": [
|
|
261
|
+
"JIT compiler",
|
|
262
|
+
"performance",
|
|
263
|
+
"GPU computing",
|
|
264
|
+
"CUDA",
|
|
265
|
+
"numerical acceleration"
|
|
266
|
+
],
|
|
267
|
+
"documentation": "https://numba.pydata.org/",
|
|
268
|
+
"repository": "https://github.com/numba/numba",
|
|
269
|
+
"installation": {
|
|
270
|
+
"pip": "pip install numba",
|
|
271
|
+
"conda": "conda install numba"
|
|
272
|
+
},
|
|
273
|
+
"usage_example": "import numba\nfrom numba import jit, njit, prange, cuda\nimport numpy as np\nimport time\nimport math\n\nprint('Numba - JIT Compiler for Python')\nprint('=' * 35)\n\n# Basic JIT compilation example\nprint('\\n=== Basic JIT Compilation ===')\n\n# Pure Python function\ndef python_function(x):\n total = 0\n for i in range(x):\n total += i * i\n return total\n\n# JIT compiled function\n@jit\ndef numba_function(x):\n total = 0\n for i in range(x):\n total += i * i\n return total\n\n# No-Python mode (faster)\n@njit\ndef numba_nopython(x):\n total = 0\n for i in range(x):\n total += i * i\n return total\n\n# Performance comparison\nn = 1000000\nprint(f'Computing sum of squares for {n:,} numbers')\n\n# Warm up JIT functions\nnumba_function(100)\nnumba_nopython(100)\n\n# Time Python function\nstart = time.time()\nresult_python = python_function(n)\ntime_python = time.time() - start\n\n# Time JIT function\nstart = time.time()\nresult_numba = numba_function(n)\ntime_numba = time.time() - start\n\n# Time no-Python JIT\nstart = time.time()\nresult_nopython = numba_nopython(n)\ntime_nopython = time.time() - start\n\nprint(f'Python result: {result_python}')\nprint(f'Numba result: {result_numba}')\nprint(f'No-Python result: {result_nopython}')\nprint(f'\\nPython time: {time_python:.4f} seconds')\nprint(f'Numba time: {time_numba:.4f} seconds')\nprint(f'No-Python time: {time_nopython:.4f} seconds')\nprint(f'Speedup (Numba): {time_python/time_numba:.1f}x')\nprint(f'Speedup (No-Python): {time_python/time_nopython:.1f}x')\n\n# NumPy array operations\nprint('\\n=== NumPy Array Operations ===')\n\n@njit\ndef matrix_multiply_numba(A, B):\n return np.dot(A, B)\n\n@njit\ndef element_wise_operation(arr):\n result = np.zeros_like(arr)\n for i in range(arr.shape[0]):\n for j in range(arr.shape[1]):\n result[i, j] = math.sqrt(arr[i, j]**2 + 1)\n return result\n\n# Create test arrays\nsize = 500\nA = np.random.random((size, size))\nB = np.random.random((size, size))\n\nprint(f'Matrix operations on {size}x{size} arrays')\n\n# Warm up\nmatrix_multiply_numba(A[:10, :10], B[:10, :10])\nelement_wise_operation(A[:10, :10])\n\n# Time NumPy operations\nstart = time.time()\nnumpy_result = np.dot(A, B)\ntime_numpy = time.time() - start\n\n# Time Numba operations\nstart = time.time()\nnumba_result = matrix_multiply_numba(A, B)\ntime_numba_matrix = time.time() - start\n\nprint(f'NumPy matrix multiply: {time_numpy:.4f} seconds')\nprint(f'Numba matrix multiply: {time_numba_matrix:.4f} seconds')\nprint(f'Results equal: {np.allclose(numpy_result, numba_result)}')\n\n# Parallel execution\nprint('\\n=== Parallel Execution ===')\n\n@njit(parallel=True)\ndef parallel_sum(arr):\n total = 0.0\n for i in prange(arr.shape[0]):\n total += arr[i]\n return total\n\n@njit\ndef serial_sum(arr):\n total = 0.0\n for i in range(arr.shape[0]):\n total += arr[i]\n return total\n\nlarge_array = np.random.random(10000000)\n\n# Warm up\nparallel_sum(large_array[:1000])\nserial_sum(large_array[:1000])\n\n# Time serial version\nstart = time.time()\nserial_result = serial_sum(large_array)\ntime_serial = time.time() - start\n\n# Time parallel version\nstart = time.time()\nparallel_result = parallel_sum(large_array)\ntime_parallel = time.time() - start\n\nprint(f'Array size: {len(large_array):,} elements')\nprint(f'Serial sum: {serial_result:.6f} ({time_serial:.4f} seconds)')\nprint(f'Parallel sum: {parallel_result:.6f} ({time_parallel:.4f} seconds)')\nprint(f'Parallel speedup: {time_serial/time_parallel:.1f}x')\n\n# Mathematical functions\nprint('\\n=== Mathematical Functions ===')\n\n@njit\ndef monte_carlo_pi(n_samples):\n count = 0\n for i in range(n_samples):\n x = np.random.random()\n y = np.random.random()\n if x*x + y*y <= 1.0:\n count += 1\n return 4.0 * count / n_samples\n\n@njit\ndef mandelbrot_point(c_real, c_imag, max_iter):\n z_real = 0.0\n z_imag = 0.0\n for i in range(max_iter):\n z_real_new = z_real*z_real - z_imag*z_imag + c_real\n z_imag_new = 2*z_real*z_imag + c_imag\n z_real = z_real_new\n z_imag = z_imag_new\n if z_real*z_real + z_imag*z_imag > 4:\n return i\n return max_iter\n\n# Monte Carlo Pi estimation\nn_samples = 1000000\nprint(f'Monte Carlo π estimation with {n_samples:,} samples')\n\nstart = time.time()\npi_estimate = monte_carlo_pi(n_samples)\ntime_mc = time.time() - start\n\nprint(f'Estimated π: {pi_estimate:.6f}')\nprint(f'Actual π: {math.pi:.6f}')\nprint(f'Error: {abs(pi_estimate - math.pi):.6f}')\nprint(f'Time: {time_mc:.4f} seconds')\n\n# Mandelbrot calculation\nprint(f'\\nMandelbrot set calculation')\nc_values = [-0.5 + 0.5j, -0.8 + 0.2j, 0.3 - 0.6j]\nmax_iterations = 1000\n\nfor c in c_values:\n iterations = mandelbrot_point(c.real, c.imag, max_iterations)\n if iterations == max_iterations:\n print(f'Point {c}: In set (>{max_iterations} iterations)')\n else:\n print(f'Point {c}: Escaped after {iterations} iterations')\n\n# Type signatures and compilation info\nprint('\\n=== Compilation Information ===')\nprint(f'Numba version: {numba.__version__}')\nprint(f'NumPy version: {np.__version__}')\n\n# Function signatures\nprint(f'\\nFunction signatures:')\nprint(f'numba_function: {numba_function.signatures}')\nprint(f'numba_nopython: {numba_nopython.signatures}')\nprint(f'parallel_sum: {parallel_sum.signatures}')\n\n# GPU example (if CUDA available)\nprint('\\n=== GPU Computing (CUDA) ===')\ntry:\n # Simple CUDA kernel example\n @cuda.jit\n def cuda_add(a, b, c):\n idx = cuda.grid(1)\n if idx < c.size:\n c[idx] = a[idx] + b[idx]\n \n # Check if CUDA is available\n if cuda.is_available():\n print('CUDA is available!')\n print(f'CUDA devices: {cuda.list_devices()}')\n \n # Small example\n n = 1000\n a = np.random.random(n).astype(np.float32)\n b = np.random.random(n).astype(np.float32)\n c = np.zeros(n, dtype=np.float32)\n \n # Configure grid and block dimensions\n threads_per_block = 128\n blocks_per_grid = (n + threads_per_block - 1) // threads_per_block\n \n print(f'Running CUDA kernel with {blocks_per_grid} blocks, {threads_per_block} threads each')\n cuda_add[blocks_per_grid, threads_per_block](a, b, c)\n \n # Verify result\n expected = a + b\n print(f'CUDA result matches NumPy: {np.allclose(c, expected)}')\n else:\n print('CUDA not available on this system')\nexcept Exception as e:\n print(f'CUDA example failed: {e}')\n\nprint('\\nNumba provides:')\nprint('• Just-in-time compilation for Python')\nprint('• Automatic parallelization with prange')\nprint('• GPU computing with CUDA support')\nprint('• NumPy array optimization')\nprint('• Minimal code changes for maximum speedup')\nprint('• Support for mathematical functions')\nprint('• Type inference and optimization')",
|
|
274
|
+
"quick_start": [
|
|
275
|
+
"Install: pip install numba",
|
|
276
|
+
"Import: from numba import jit, njit",
|
|
277
|
+
"Decorate: @jit or @njit above functions",
|
|
278
|
+
"Parallel: @njit(parallel=True) with prange",
|
|
279
|
+
"GPU: @cuda.jit for CUDA kernels",
|
|
280
|
+
"Enjoy automatic speed improvements!"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"type": "PackageTool",
|
|
286
|
+
"name": "get_flask_info",
|
|
287
|
+
"description": "Get comprehensive information about Flask - a lightweight WSGI web application framework",
|
|
288
|
+
"parameter": {
|
|
289
|
+
"type": "object",
|
|
290
|
+
"properties": {
|
|
291
|
+
"include_examples": {
|
|
292
|
+
"type": "boolean",
|
|
293
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
294
|
+
"default": true
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"package_name": "flask",
|
|
299
|
+
"local_info": {
|
|
300
|
+
"name": "Flask",
|
|
301
|
+
"description": "A lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.",
|
|
302
|
+
"category": "Web Framework",
|
|
303
|
+
"import_name": "flask",
|
|
304
|
+
"popularity": 85,
|
|
305
|
+
"keywords": [
|
|
306
|
+
"web",
|
|
307
|
+
"framework",
|
|
308
|
+
"wsgi",
|
|
309
|
+
"http",
|
|
310
|
+
"server"
|
|
311
|
+
],
|
|
312
|
+
"documentation": "https://flask.palletsprojects.com/",
|
|
313
|
+
"repository": "https://github.com/pallets/flask",
|
|
314
|
+
"installation": {
|
|
315
|
+
"pip": "pip install Flask",
|
|
316
|
+
"conda": "conda install flask"
|
|
317
|
+
},
|
|
318
|
+
"usage_example": "from flask import Flask\n\napp = Flask(__name__)\n\n@app.route('/')\ndef hello_world():\n return 'Hello, World!'\n\n@app.route('/user/<name>')\ndef user_profile(name):\n return f'Hello, {name}!'\n\nif __name__ == '__main__':\n app.run(debug=True)",
|
|
319
|
+
"quick_start": [
|
|
320
|
+
"1. Install Flask: pip install Flask",
|
|
321
|
+
"2. Create app: from flask import Flask; app = Flask(__name__)",
|
|
322
|
+
"3. Define routes: @app.route('/') def home(): return 'Hello!'",
|
|
323
|
+
"4. Run the app: app.run(debug=True)",
|
|
324
|
+
"5. Visit http://localhost:5000 in your browser"
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"type": "PackageTool",
|
|
330
|
+
"name": "get_googlesearch_python_info",
|
|
331
|
+
"description": "Get comprehensive information about googlesearch-python – Google search automation",
|
|
332
|
+
"parameter": {
|
|
333
|
+
"type": "object",
|
|
334
|
+
"properties": {
|
|
335
|
+
"info_type": {
|
|
336
|
+
"type": "string",
|
|
337
|
+
"enum": [
|
|
338
|
+
"overview",
|
|
339
|
+
"installation",
|
|
340
|
+
"usage",
|
|
341
|
+
"documentation"
|
|
342
|
+
],
|
|
343
|
+
"description": "Type of information to retrieve about googlesearch-python"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"required": [
|
|
347
|
+
"info_type"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
"package_name": "googlesearch-python",
|
|
351
|
+
"local_info": {
|
|
352
|
+
"name": "googlesearch-python",
|
|
353
|
+
"description": "Python library for performing Google searches programmatically. Provides simple interface to retrieve search results, URLs, and snippets without requiring API keys.",
|
|
354
|
+
"category": "Web Scraping / Search",
|
|
355
|
+
"import_name": "googlesearch",
|
|
356
|
+
"popularity": 70,
|
|
357
|
+
"keywords": [
|
|
358
|
+
"Google search",
|
|
359
|
+
"web scraping",
|
|
360
|
+
"search automation",
|
|
361
|
+
"information retrieval"
|
|
362
|
+
],
|
|
363
|
+
"documentation": "https://github.com/MarioVilas/googlesearch",
|
|
364
|
+
"repository": "https://github.com/MarioVilas/googlesearch",
|
|
365
|
+
"installation": {
|
|
366
|
+
"pip": "pip install googlesearch-python",
|
|
367
|
+
"conda": "conda install -c conda-forge googlesearch-python"
|
|
368
|
+
},
|
|
369
|
+
"usage_example": "from googlesearch import search\nimport time\nimport requests\nfrom urllib.parse import urlparse\n\n# Basic search example\nquery = 'python data science'\nprint(f'Searching for: \"{query}\"')\n\n# Get top 5 search results\ntry:\n results = list(search(query, num_results=5, sleep_interval=1))\n \n print(f'Found {len(results)} results:')\n for i, url in enumerate(results, 1):\n print(f'{i}. {url}')\n \n # Extract domain\n domain = urlparse(url).netloc\n print(f' Domain: {domain}')\n \n # Add delay to be respectful\n time.sleep(0.5)\n \nexcept Exception as e:\n print(f'Search failed: {e}')\n\n# Advanced search with parameters\nprint('\\nAdvanced search example:')\nadvanced_query = 'machine learning papers site:arxiv.org'\n\ntry:\n arxiv_results = list(search(\n advanced_query,\n num_results=3,\n lang='en',\n region='us',\n sleep_interval=2\n ))\n \n print(f'ArXiv ML papers ({len(arxiv_results)} results):')\n for url in arxiv_results:\n print(f'- {url}')\n \nexcept Exception as e:\n print(f'Advanced search failed: {e}')\n\n# Search with different domains\nprint('\\nDomain-specific searches:')\ndomains = ['github.com', 'stackoverflow.com', 'medium.com']\n\nfor domain in domains:\n domain_query = f'pytorch tutorial site:{domain}'\n try:\n domain_results = list(search(domain_query, num_results=2, sleep_interval=1))\n print(f'{domain}: {len(domain_results)} results')\n for url in domain_results[:1]: # Show first result\n print(f' {url}')\n except:\n print(f'{domain}: Search failed')\n \nprint('\\nNote: Be respectful with search frequency to avoid rate limiting')",
|
|
370
|
+
"quick_start": [
|
|
371
|
+
"Install: pip install googlesearch-python",
|
|
372
|
+
"Import: from googlesearch import search",
|
|
373
|
+
"Basic search: search('query', num_results=10)",
|
|
374
|
+
"Add delays: sleep_interval parameter",
|
|
375
|
+
"Filter by site: 'query site:domain.com'",
|
|
376
|
+
"Use responsibly to avoid rate limits"
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"type": "PackageTool",
|
|
382
|
+
"name": "get_cryosparc_tools_info",
|
|
383
|
+
"description": "Get comprehensive information about cryosparc-tools – interface to CryoSPARC cryo-EM processing",
|
|
384
|
+
"parameter": {
|
|
385
|
+
"type": "object",
|
|
386
|
+
"properties": {
|
|
387
|
+
"info_type": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"enum": [
|
|
390
|
+
"overview",
|
|
391
|
+
"installation",
|
|
392
|
+
"usage",
|
|
393
|
+
"documentation"
|
|
394
|
+
],
|
|
395
|
+
"description": "Type of information to retrieve about cryosparc-tools"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"required": [
|
|
399
|
+
"info_type"
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
"package_name": "cryosparc-tools",
|
|
403
|
+
"local_info": {
|
|
404
|
+
"name": "cryosparc-tools",
|
|
405
|
+
"description": "Python tools for interacting with CryoSPARC cryo-electron microscopy data processing software. Provides programmatic access to projects, datasets, and results for automated workflows and analysis.",
|
|
406
|
+
"category": "Cryo-EM / Structural Biology",
|
|
407
|
+
"import_name": "cryosparc",
|
|
408
|
+
"popularity": 55,
|
|
409
|
+
"keywords": [
|
|
410
|
+
"cryo-EM",
|
|
411
|
+
"CryoSPARC",
|
|
412
|
+
"structural biology",
|
|
413
|
+
"electron microscopy",
|
|
414
|
+
"image processing"
|
|
415
|
+
],
|
|
416
|
+
"documentation": "https://cryosparc.com/docs",
|
|
417
|
+
"repository": "https://github.com/cryosparc/cryosparc-tools",
|
|
418
|
+
"installation": {
|
|
419
|
+
"pip": "pip install cryosparc-tools",
|
|
420
|
+
"conda": "conda install -c conda-forge cryosparc-tools"
|
|
421
|
+
},
|
|
422
|
+
"usage_example": "# Note: This example assumes CryoSPARC server access\n# from cryosparc.client import Client\n# import numpy as np\n\n# Connect to CryoSPARC instance\n# client = Client(\n# license='YOUR_LICENSE',\n# host='localhost',\n# base_port=39000,\n# email='user@example.com',\n# password='password'\n# )\n\nprint('CryoSPARC Tools Usage Example:')\nprint('\\n1. Connection:')\nprint(' client = Client(license, host, base_port, email, password)')\n\nprint('\\n2. Project Management:')\nprint(' projects = client.get_projects()')\nprint(' project = client.create_project(\"My Project\")')\n\nprint('\\n3. Dataset Operations:')\nprint(' datasets = client.get_datasets(project_uid)')\nprint(' particles = client.get_particles(dataset_uid)')\n\nprint('\\n4. Job Management:')\nprint(' jobs = client.get_jobs(project_uid)')\nprint(' job = client.create_job(project_uid, job_type)')\n\nprint('\\n5. Data Analysis:')\nprint(' # Access particle data')\nprint(' # positions = particles[\"alignments2D/pose\"]')\nprint(' # ctf_params = particles[\"ctf/df1_A\"]')\n\nprint('\\n6. Results Export:')\nprint(' # Export maps, particles, or metadata')\nprint(' # client.download_dataset(dataset_uid, \"output.cs\")')\n\nprint('\\nNote: Requires active CryoSPARC installation and license')\nprint('Used for:')\nprint('- Automated cryo-EM workflows')\nprint('- Batch processing of datasets')\nprint('- Custom analysis pipelines')\nprint('- Integration with other tools')",
|
|
423
|
+
"quick_start": [
|
|
424
|
+
"Install: pip install cryosparc-tools",
|
|
425
|
+
"Connect: Client(license, host, port, email, password)",
|
|
426
|
+
"Access projects: client.get_projects()",
|
|
427
|
+
"Manage datasets: client.get_datasets()",
|
|
428
|
+
"Run jobs: client.create_job()",
|
|
429
|
+
"Requires CryoSPARC server access"
|
|
430
|
+
]
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"type": "PackageTool",
|
|
435
|
+
"name": "get_tskit_info",
|
|
436
|
+
"description": "Get comprehensive information about tskit – tree sequence toolkit for population genetics",
|
|
437
|
+
"parameter": {
|
|
438
|
+
"type": "object",
|
|
439
|
+
"properties": {
|
|
440
|
+
"info_type": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"enum": [
|
|
443
|
+
"overview",
|
|
444
|
+
"installation",
|
|
445
|
+
"usage",
|
|
446
|
+
"documentation"
|
|
447
|
+
],
|
|
448
|
+
"description": "Type of information to retrieve about tskit"
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"required": [
|
|
452
|
+
"info_type"
|
|
453
|
+
]
|
|
454
|
+
},
|
|
455
|
+
"package_name": "tskit",
|
|
456
|
+
"local_info": {
|
|
457
|
+
"name": "tskit",
|
|
458
|
+
"description": "Tree sequence toolkit for storing and analyzing genetic variation data efficiently. Provides succinct representation of genealogical relationships and genetic variants for population genetic analysis.",
|
|
459
|
+
"category": "Population Genetics",
|
|
460
|
+
"import_name": "tskit",
|
|
461
|
+
"popularity": 75,
|
|
462
|
+
"keywords": [
|
|
463
|
+
"tree sequences",
|
|
464
|
+
"population genetics",
|
|
465
|
+
"genealogy",
|
|
466
|
+
"coalescent",
|
|
467
|
+
"genetic variation"
|
|
468
|
+
],
|
|
469
|
+
"documentation": "https://tskit.dev/tskit/docs/stable/",
|
|
470
|
+
"repository": "https://github.com/tskit-dev/tskit",
|
|
471
|
+
"installation": {
|
|
472
|
+
"pip": "pip install tskit",
|
|
473
|
+
"conda": "conda install -c conda-forge tskit"
|
|
474
|
+
},
|
|
475
|
+
"usage_example": "import tskit\nimport numpy as np\n\n# Load tree sequence from file\nts = tskit.load('example.trees')\n\nprint(f'Number of samples: {ts.num_samples}')\nprint(f'Number of trees: {ts.num_trees}')\nprint(f'Number of sites: {ts.num_sites}')\n\n# Iterate through trees\nfor tree in ts.trees():\n print(f'Tree {tree.index}: interval [{tree.interval.left}, {tree.interval.right})')\n \n # Calculate tree statistics\n print(f' TMRCA: {tree.tmrca(tree.roots[0]):.4f}')\n print(f' Total branch length: {tree.total_branch_length:.4f}')\n\n# Calculate diversity statistics\ndiversity = ts.diversity()\nprint(f'Nucleotide diversity: {diversity:.6f}')\n\n# Calculate Tajima's D\ntaj_d = ts.Tajimas_D()\nprint(f\"Tajima's D: {taj_d:.4f}\")",
|
|
476
|
+
"quick_start": [
|
|
477
|
+
"Install: pip install tskit",
|
|
478
|
+
"Load tree sequence: ts = tskit.load('file.trees')",
|
|
479
|
+
"Iterate trees: for tree in ts.trees()",
|
|
480
|
+
"Calculate diversity: ts.diversity()",
|
|
481
|
+
"Compute statistics: ts.Tajimas_D()",
|
|
482
|
+
"Access sample data: ts.samples()"
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"type": "PackageTool",
|
|
488
|
+
"name": "get_fanc_info",
|
|
489
|
+
"description": "Get comprehensive information about FAN-C – framework for analyzing nuclear contacts",
|
|
490
|
+
"parameter": {
|
|
491
|
+
"type": "object",
|
|
492
|
+
"properties": {
|
|
493
|
+
"info_type": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"enum": [
|
|
496
|
+
"overview",
|
|
497
|
+
"installation",
|
|
498
|
+
"usage",
|
|
499
|
+
"documentation"
|
|
500
|
+
],
|
|
501
|
+
"description": "Type of information to retrieve about FAN-C"
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"required": [
|
|
505
|
+
"info_type"
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
"package_name": "fanc",
|
|
509
|
+
"local_info": {
|
|
510
|
+
"name": "FAN-C",
|
|
511
|
+
"description": "Framework for Analyzing Nuclear Contacts - comprehensive toolkit for Hi-C and 3C-seq data analysis. Provides tools for processing, visualization, and analysis of chromosome conformation capture data.",
|
|
512
|
+
"category": "3D Genomics / Hi-C Analysis",
|
|
513
|
+
"import_name": "fanc",
|
|
514
|
+
"popularity": 65,
|
|
515
|
+
"keywords": [
|
|
516
|
+
"Hi-C",
|
|
517
|
+
"3C-seq",
|
|
518
|
+
"chromosome conformation",
|
|
519
|
+
"3D genomics",
|
|
520
|
+
"contact matrices"
|
|
521
|
+
],
|
|
522
|
+
"documentation": "https://fan-c.readthedocs.io/",
|
|
523
|
+
"repository": "https://github.com/vaquerizaslab/fanc",
|
|
524
|
+
"installation": {
|
|
525
|
+
"pip": "pip install fanc",
|
|
526
|
+
"conda": "conda install -c bioconda fanc"
|
|
527
|
+
},
|
|
528
|
+
"usage_example": "import fanc\nimport fanc.plotting as fancplot\nimport matplotlib.pyplot as plt\n\n# Load Hi-C data (example with built-in test data)\n# hic = fanc.load('sample.hic') # Load from file\n\n# For demonstration, create synthetic contact matrix\nimport numpy as np\nn_bins = 100\ncontact_matrix = np.random.exponential(1, (n_bins, n_bins))\n# Make symmetric\ncontact_matrix = (contact_matrix + contact_matrix.T) / 2\n# Add diagonal decay\nfor i in range(n_bins):\n for j in range(n_bins):\n contact_matrix[i, j] *= np.exp(-abs(i-j)/10)\n\nprint(f'Contact matrix shape: {contact_matrix.shape}')\nprint(f'Matrix sum: {contact_matrix.sum():.2e}')\n\n# Basic analysis\n# Calculate insulation score (measure of TAD boundaries)\ninsulation_score = np.array([contact_matrix[max(0, i-5):i+6, max(0, i-5):i+6].sum() \n for i in range(n_bins)])\n\nprint(f'Insulation scores range: {insulation_score.min():.2f} - {insulation_score.max():.2f}')\n\n# Visualization\nfig, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 8))\n\n# Plot contact matrix\nim = ax1.imshow(contact_matrix, cmap='Reds', interpolation='nearest')\nax1.set_title('Hi-C Contact Matrix')\nax1.set_xlabel('Genomic Bin')\nax1.set_ylabel('Genomic Bin')\nplt.colorbar(im, ax=ax1)\n\n# Plot insulation score\nax2.plot(insulation_score, 'b-', linewidth=2)\nax2.set_title('Insulation Score (TAD Boundaries)')\nax2.set_xlabel('Genomic Bin')\nax2.set_ylabel('Insulation Score')\nax2.grid(True, alpha=0.3)\n\nplt.tight_layout()\nplt.show()\n\nprint('FAN-C provides comprehensive Hi-C analysis including:')\nprint('- Contact matrix processing and normalization')\nprint('- TAD and loop calling')\nprint('- Comparative analysis between samples')\nprint('- Publication-ready visualizations')",
|
|
529
|
+
"quick_start": [
|
|
530
|
+
"Install: pip install fanc",
|
|
531
|
+
"Load data: hic = fanc.load('file.hic')",
|
|
532
|
+
"Plot matrix: fanc.plotting.TriangularMatrixPlot()",
|
|
533
|
+
"Find TADs: fanc.insulation()",
|
|
534
|
+
"Call loops: fanc.peaks()",
|
|
535
|
+
"Export results: fanc.to_cooler() or fanc.to_bigwig()"
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"type": "PackageTool",
|
|
541
|
+
"name": "get_pybigwig_info",
|
|
542
|
+
"description": "Get comprehensive information about pyBigWig – BigWig file access in Python",
|
|
543
|
+
"parameter": {
|
|
544
|
+
"type": "object",
|
|
545
|
+
"properties": {
|
|
546
|
+
"info_type": {
|
|
547
|
+
"type": "string",
|
|
548
|
+
"enum": [
|
|
549
|
+
"overview",
|
|
550
|
+
"installation",
|
|
551
|
+
"usage",
|
|
552
|
+
"documentation"
|
|
553
|
+
],
|
|
554
|
+
"description": "Type of information to retrieve about pyBigWig"
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
"required": [
|
|
558
|
+
"info_type"
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
"package_name": "pyBigWig",
|
|
562
|
+
"local_info": {
|
|
563
|
+
"name": "pyBigWig",
|
|
564
|
+
"description": "Python interface for accessing BigWig files, which store dense continuous data such as coverage tracks from sequencing experiments. Provides efficient random access to genomic interval data.",
|
|
565
|
+
"category": "Genomics File I/O",
|
|
566
|
+
"import_name": "pyBigWig",
|
|
567
|
+
"popularity": 82,
|
|
568
|
+
"keywords": [
|
|
569
|
+
"BigWig",
|
|
570
|
+
"genomics",
|
|
571
|
+
"coverage",
|
|
572
|
+
"ChIP-seq",
|
|
573
|
+
"RNA-seq",
|
|
574
|
+
"track data"
|
|
575
|
+
],
|
|
576
|
+
"documentation": "https://github.com/deeptools/pyBigWig",
|
|
577
|
+
"repository": "https://github.com/deeptools/pyBigWig",
|
|
578
|
+
"installation": {
|
|
579
|
+
"pip": "pip install pyBigWig",
|
|
580
|
+
"conda": "conda install -c conda-forge pybigwig"
|
|
581
|
+
},
|
|
582
|
+
"usage_example": "import pyBigWig\nimport numpy as np\n\n# Open BigWig file\nbw = pyBigWig.open('example.bw')\n\n# Get information about the file\nprint(f'Chromosomes: {bw.chroms()}')\nprint(f'Header: {bw.header()}')\n\n# Get values for a specific region\nvalues = bw.values('chr1', 1000, 2000)\nprint(f'Mean value: {np.nanmean(values):.3f}')\n\n# Get stats for a region\nstats = bw.stats('chr1', 1000, 2000, type='mean')\nprint(f'Region mean: {stats[0]:.3f}')\n\n# Get intervals above threshold\nintervals = bw.intervals('chr1', 1000, 2000)\nfor start, end, value in intervals:\n if value > 10:\n print(f'{start}-{end}: {value}')\n\nbw.close()",
|
|
583
|
+
"quick_start": [
|
|
584
|
+
"Install: pip install pyBigWig",
|
|
585
|
+
"Open file: bw = pyBigWig.open('file.bw')",
|
|
586
|
+
"Get values: bw.values('chr1', start, end)",
|
|
587
|
+
"Get statistics: bw.stats('chr1', start, end)",
|
|
588
|
+
"Get intervals: bw.intervals('chr1', start, end)",
|
|
589
|
+
"Always close: bw.close()"
|
|
590
|
+
]
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"type": "PackageTool",
|
|
595
|
+
"name": "get_arxiv_info",
|
|
596
|
+
"description": "Get comprehensive information about arxiv – access to arXiv preprint repository",
|
|
597
|
+
"parameter": {
|
|
598
|
+
"type": "object",
|
|
599
|
+
"properties": {
|
|
600
|
+
"include_examples": {
|
|
601
|
+
"type": "boolean",
|
|
602
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
603
|
+
"default": true
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
"package_name": "arxiv",
|
|
608
|
+
"local_info": {
|
|
609
|
+
"name": "arxiv",
|
|
610
|
+
"description": "Python wrapper for the arXiv API. Allows programmatic access to arXiv preprint repository for searching, downloading, and parsing scientific papers.",
|
|
611
|
+
"category": "Literature Mining",
|
|
612
|
+
"import_name": "arxiv",
|
|
613
|
+
"popularity": 75,
|
|
614
|
+
"keywords": [
|
|
615
|
+
"arXiv",
|
|
616
|
+
"preprints",
|
|
617
|
+
"scientific papers",
|
|
618
|
+
"literature search",
|
|
619
|
+
"academic research"
|
|
620
|
+
],
|
|
621
|
+
"documentation": "https://github.com/lukasschwab/arxiv.py",
|
|
622
|
+
"repository": "https://github.com/lukasschwab/arxiv.py",
|
|
623
|
+
"installation": {
|
|
624
|
+
"pip": "pip install arxiv",
|
|
625
|
+
"conda": "conda install -c conda-forge arxiv"
|
|
626
|
+
},
|
|
627
|
+
"usage_example": "import arxiv\n\n# Search for papers\nsearch = arxiv.Search(\n query='machine learning AND biology',\n max_results=10,\n sort_by=arxiv.SortCriterion.SubmittedDate\n)\n\n# Iterate through results\nfor result in search.results():\n print(f'Title: {result.title}')\n print(f'Authors: {[author.name for author.name in result.authors]}')\n print(f'Published: {result.published}')\n print(f'Categories: {result.categories}')\n print(f'Abstract: {result.summary[:200]}...')\n print(f'PDF URL: {result.pdf_url}')\n print('---')",
|
|
628
|
+
"quick_start": [
|
|
629
|
+
"1. Install arxiv: pip install arxiv",
|
|
630
|
+
"2. Import: import arxiv",
|
|
631
|
+
"3. Search: search = arxiv.Search(query='machine learning')",
|
|
632
|
+
"4. Iterate: for result in search.results():",
|
|
633
|
+
"5. Access: result.title, result.authors, result.pdf_url"
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"type": "PackageTool",
|
|
639
|
+
"name": "get_plip_info",
|
|
640
|
+
"description": "Get comprehensive information about PLIP – protein-ligand interaction profiler",
|
|
641
|
+
"parameter": {
|
|
642
|
+
"type": "object",
|
|
643
|
+
"properties": {
|
|
644
|
+
"info_type": {
|
|
645
|
+
"type": "string",
|
|
646
|
+
"enum": [
|
|
647
|
+
"overview",
|
|
648
|
+
"installation",
|
|
649
|
+
"usage",
|
|
650
|
+
"documentation"
|
|
651
|
+
],
|
|
652
|
+
"description": "Type of information to retrieve about PLIP"
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
"required": [
|
|
656
|
+
"info_type"
|
|
657
|
+
]
|
|
658
|
+
},
|
|
659
|
+
"package_name": "plip",
|
|
660
|
+
"local_info": {
|
|
661
|
+
"name": "PLIP",
|
|
662
|
+
"description": "Protein-Ligand Interaction Profiler for analyzing and visualizing non-covalent protein-ligand interactions in PDB files. Identifies hydrogen bonds, hydrophobic contacts, π-interactions, and salt bridges.",
|
|
663
|
+
"category": "Structural Biology / Drug Discovery",
|
|
664
|
+
"import_name": "plip",
|
|
665
|
+
"popularity": 70,
|
|
666
|
+
"keywords": [
|
|
667
|
+
"protein-ligand interactions",
|
|
668
|
+
"structural biology",
|
|
669
|
+
"drug discovery",
|
|
670
|
+
"PDB analysis",
|
|
671
|
+
"molecular recognition"
|
|
672
|
+
],
|
|
673
|
+
"documentation": "https://github.com/pharmai/plip",
|
|
674
|
+
"repository": "https://github.com/pharmai/plip",
|
|
675
|
+
"installation": {
|
|
676
|
+
"pip": "pip install plip",
|
|
677
|
+
"conda": "conda install -c conda-forge plip"
|
|
678
|
+
},
|
|
679
|
+
"usage_example": "# PLIP is primarily a command-line tool, but we can demonstrate concepts\nfrom plip.structure.preparation import PDBComplex\nfrom plip.exchange.report import BindingSiteReport\nimport tempfile\nimport os\nimport numpy as np\n\nprint('PLIP - Protein-Ligand Interaction Profiler')\nprint('=' * 45)\n\n# PLIP analyzes these interaction types:\nprint('PLIP identifies these interaction types:')\nprint('• Hydrogen bonds (conventional and weak)')\nprint('• Hydrophobic contacts')\nprint('• π-π stacking interactions')\nprint('• π-cation interactions')\nprint('• Salt bridges')\nprint('• Water-mediated interactions')\nprint('• Halogen bonds')\nprint('• Metal coordination')\n\n# Create a synthetic protein-ligand complex for demonstration\nprint('\\nCreating synthetic protein-ligand complex...')\n\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.pdb', delete=False) as f:\n f.write('HEADER PROTEIN-LIGAND COMPLEX 01-SEP-25\\n')\n f.write('TITLE DEMONSTRATION COMPLEX FOR PLIP\\n')\n \n atom_id = 1\n \n # Create protein binding pocket (simplified)\n protein_atoms = [\n # Binding pocket residues\n ('ALA', 1, [('N', 10.0, 10.0, 10.0), ('CA', 10.5, 10.5, 10.0), \n ('C', 11.0, 10.0, 10.0), ('O', 11.5, 10.0, 9.5)]),\n ('SER', 2, [('N', 12.0, 10.0, 10.5), ('CA', 12.5, 10.5, 11.0),\n ('C', 13.0, 10.0, 11.5), ('O', 13.5, 10.5, 12.0),\n ('OG', 12.0, 11.5, 11.5)]), # Hydroxyl for H-bond\n ('PHE', 3, [('N', 14.0, 10.0, 12.0), ('CA', 14.5, 10.5, 12.5),\n ('C', 15.0, 10.0, 13.0), ('O', 15.5, 10.5, 13.5),\n ('CG', 14.0, 11.5, 13.0), ('CD1', 13.5, 12.0, 13.5),\n ('CD2', 14.0, 12.0, 12.5), ('CE1', 13.0, 13.0, 13.5),\n ('CE2', 13.5, 13.0, 12.5), ('CZ', 13.0, 13.5, 13.0)]), # Aromatic ring\n ('LYS', 4, [('N', 16.0, 10.0, 14.0), ('CA', 16.5, 10.5, 14.5),\n ('C', 17.0, 10.0, 15.0), ('O', 17.5, 10.5, 15.5),\n ('NZ', 16.0, 11.5, 15.0)]) # Positive charge\n ]\n \n for res_name, res_id, atoms in protein_atoms:\n for atom_name, x, y, z in atoms:\n f.write(f'ATOM {atom_id:5d} {atom_name:4s}{res_name:>3s} A{res_id:4d} '\n f'{x:8.3f}{y:8.3f}{z:8.3f} 1.00 20.00 {atom_name[0]:>2s}\\n')\n atom_id += 1\n \n # Create ligand (small molecule)\n f.write('HETATM{:5d} C1 LIG A 100 {:8.3f}{:8.3f}{:8.3f} 1.00 20.00 C\\n'\n .format(atom_id, 12.0, 12.0, 11.0))\n atom_id += 1\n f.write('HETATM{:5d} C2 LIG A 100 {:8.3f}{:8.3f}{:8.3f} 1.00 20.00 C\\n'\n .format(atom_id, 13.0, 12.5, 11.5))\n atom_id += 1\n f.write('HETATM{:5d} O1 LIG A 100 {:8.3f}{:8.3f}{:8.3f} 1.00 20.00 O\\n'\n .format(atom_id, 11.5, 11.5, 11.5)) # H-bond acceptor\n atom_id += 1\n f.write('HETATM{:5d} N1 LIG A 100 {:8.3f}{:8.3f}{:8.3f} 1.00 20.00 N\\n'\n .format(atom_id, 13.5, 13.0, 12.0)) # H-bond donor\n atom_id += 1\n f.write('HETATM{:5d} C3 LIG A 100 {:8.3f}{:8.3f}{:8.3f} 1.00 20.00 C\\n'\n .format(atom_id, 14.0, 12.0, 12.5)) # Hydrophobic\n atom_id += 1\n \n # Aromatic ring in ligand for π-π interaction\n aromatic_center = (13.0, 13.0, 13.0)\n for i, (dx, dy) in enumerate([(0, 1.4), (1.2, 0.7), (1.2, -0.7), (0, -1.4), (-1.2, -0.7), (-1.2, 0.7)]):\n x = aromatic_center[0] + dx\n y = aromatic_center[1] + dy\n z = aromatic_center[2]\n f.write('HETATM{:5d} C{:1d} LIG A 100 {:8.3f}{:8.3f}{:8.3f} 1.00 20.00 C\\n'\n .format(atom_id, i+6, x, y, z))\n atom_id += 1\n \n f.write('END\\n')\n pdb_file = f.name\n\nprint(f'Created synthetic PDB file: {pdb_file}')\n\n# PLIP analysis concepts (simplified since we can't run full PLIP)\nprint('\\n=== PLIP Analysis Concepts ===')\n\n# Load PDB and identify potential interactions\nprint('\\n1. Structure Loading and Preparation:')\nprint(f' - Loading PDB file: {pdb_file}')\nprint(' - Identifying protein chains and ligands')\nprint(' - Preparing structures (adding hydrogens, etc.)')\n\n# Simulate interaction detection\nprint('\\n2. Interaction Detection:')\n\n# Define interaction criteria (simplified)\ninteraction_criteria = {\n 'hydrogen_bond': {\n 'distance_cutoff': 3.5, # Angstroms\n 'angle_cutoff': 120 # degrees\n },\n 'hydrophobic_contact': {\n 'distance_cutoff': 4.0 # Angstroms\n },\n 'pi_pi_stacking': {\n 'distance_cutoff': 5.0, # Angstroms\n 'angle_cutoff': 30 # degrees from parallel\n },\n 'pi_cation': {\n 'distance_cutoff': 6.0 # Angstroms\n },\n 'salt_bridge': {\n 'distance_cutoff': 4.0 # Angstroms\n }\n}\n\nprint('Interaction detection criteria:')\nfor interaction_type, criteria in interaction_criteria.items():\n print(f' {interaction_type}:')\n for param, value in criteria.items():\n unit = 'Å' if 'distance' in param else '°'\n print(f' {param}: {value} {unit}')\n\n# Simulate detected interactions\ndetected_interactions = [\n {\n 'type': 'hydrogen_bond',\n 'protein_residue': 'SER2',\n 'protein_atom': 'OG',\n 'ligand_atom': 'O1',\n 'distance': 2.8,\n 'angle': 165.0,\n 'strength': 'strong'\n },\n {\n 'type': 'hydrogen_bond',\n 'protein_residue': 'SER2',\n 'protein_atom': 'N',\n 'ligand_atom': 'N1',\n 'distance': 3.1,\n 'angle': 140.0,\n 'strength': 'medium'\n },\n {\n 'type': 'hydrophobic_contact',\n 'protein_residue': 'ALA1',\n 'protein_atom': 'CB',\n 'ligand_atom': 'C3',\n 'distance': 3.7,\n 'strength': 'weak'\n },\n {\n 'type': 'pi_pi_stacking',\n 'protein_residue': 'PHE3',\n 'protein_atom': 'CZ',\n 'ligand_atom': 'C6-ring',\n 'distance': 4.2,\n 'angle': 15.0,\n 'strength': 'medium'\n },\n {\n 'type': 'pi_cation',\n 'protein_residue': 'LYS4',\n 'protein_atom': 'NZ',\n 'ligand_atom': 'C6-ring',\n 'distance': 5.1,\n 'strength': 'medium'\n }\n]\n\nprint('\\n3. Detected Interactions:')\nprint(f' Total interactions found: {len(detected_interactions)}')\n\ninteraction_counts = {}\nfor interaction in detected_interactions:\n itype = interaction['type']\n interaction_counts[itype] = interaction_counts.get(itype, 0) + 1\n\nfor itype, count in interaction_counts.items():\n print(f' {itype.replace(\"_\", \" \").title()}: {count}')\n\nprint('\\nDetailed interaction analysis:')\nfor i, interaction in enumerate(detected_interactions, 1):\n print(f' {i}. {interaction[\"type\"].replace(\"_\", \" \").title()}')\n print(f' Protein: {interaction[\"protein_residue\"]} ({interaction[\"protein_atom\"]})')\n print(f' Ligand: {interaction[\"ligand_atom\"]}')\n print(f' Distance: {interaction[\"distance\"]:.1f} Å')\n if 'angle' in interaction:\n print(f' Angle: {interaction[\"angle\"]:.1f}°')\n print(f' Strength: {interaction[\"strength\"]}')\n print()\n\n# Binding affinity estimation\nprint('4. Binding Affinity Estimation:')\n\n# Simple scoring based on interactions\nscoring_weights = {\n 'hydrogen_bond': {'strong': 2.0, 'medium': 1.5, 'weak': 1.0},\n 'hydrophobic_contact': {'strong': 1.0, 'medium': 0.7, 'weak': 0.5},\n 'pi_pi_stacking': {'strong': 1.5, 'medium': 1.2, 'weak': 0.8},\n 'pi_cation': {'strong': 1.5, 'medium': 1.2, 'weak': 0.8},\n 'salt_bridge': {'strong': 2.5, 'medium': 2.0, 'weak': 1.5}\n}\n\ntotal_score = 0\nfor interaction in detected_interactions:\n itype = interaction['type']\n strength = interaction['strength']\n score = scoring_weights.get(itype, {}).get(strength, 0)\n total_score += score\n print(f' {interaction[\"type\"]} ({strength}): +{score:.1f}')\n\nprint(f'\\n Total interaction score: {total_score:.1f}')\nprint(f' Estimated binding strength: {\"Strong\" if total_score > 8 else \"Medium\" if total_score > 4 else \"Weak\"}')\n\n# Pharmacophore analysis\nprint('\\n5. Pharmacophore Analysis:')\n\npharmacophore_features = {\n 'hydrogen_bond_donor': 1,\n 'hydrogen_bond_acceptor': 1, \n 'hydrophobic_center': 1,\n 'aromatic_ring': 1,\n 'positive_ionizable': 0,\n 'negative_ionizable': 0\n}\n\nprint(' Key pharmacophore features in ligand:')\nfor feature, count in pharmacophore_features.items():\n if count > 0:\n print(f' {feature.replace(\"_\", \" \").title()}: {count}')\n\n# Drug-likeness assessment\nprint('\\n6. Drug-likeness Assessment (conceptual):')\n\n# Simplified molecular properties\nmol_properties = {\n 'molecular_weight': 250.3, # Simulated\n 'logP': 2.1, # Simulated\n 'hbd': 1, # Hydrogen bond donors\n 'hba': 2, # Hydrogen bond acceptors\n 'rotatable_bonds': 3,\n 'aromatic_rings': 1\n}\n\nprint(' Molecular properties:')\nfor prop, value in mol_properties.items():\n print(f' {prop.replace(\"_\", \" \").title()}: {value}')\n\n# Lipinski's Rule of Five\nlipinski_violations = 0\nif mol_properties['molecular_weight'] > 500:\n lipinski_violations += 1\nif mol_properties['logP'] > 5:\n lipinski_violations += 1\nif mol_properties['hbd'] > 5:\n lipinski_violations += 1\nif mol_properties['hba'] > 10:\n lipinski_violations += 1\n\nprint(f'\\n Lipinski Rule of Five violations: {lipinski_violations}/4')\nprint(f' Drug-likeness: {\"Good\" if lipinski_violations <= 1 else \"Poor\"}')\n\n# Visualization concepts\nprint('\\n=== Visualization and Output ===')\n\nprint('PLIP generates:')\nprint('• Interaction diagrams (2D and 3D)')\nprint('• Detailed interaction reports')\nprint('• PyMOL visualization scripts')\nprint('• XML/JSON output formats')\nprint('• Statistical summaries')\nprint('• Binding site characterization')\n\n# Create a simple interaction summary\nprint('\\n=== Interaction Summary Report ===')\nprint('=' * 45)\nprint(f'PDB File: {os.path.basename(pdb_file)}')\nprint(f'Ligand: LIG (Chain A, Residue 100)')\nprint(f'Binding Site: Chain A')\nprint(f'\\nInteraction Summary:')\nprint(f' Total Interactions: {len(detected_interactions)}')\nfor itype, count in interaction_counts.items():\n print(f' {itype.replace(\"_\", \" \").title()}: {count}')\nprint(f'\\nBinding Assessment:')\nprint(f' Interaction Score: {total_score:.1f}')\nprint(f' Binding Strength: {\"Strong\" if total_score > 8 else \"Medium\" if total_score > 4 else \"Weak\"}')\nprint(f' Drug-likeness: {\"Good\" if lipinski_violations <= 1 else \"Poor\"}')\nprint(f'\\nKey Interactions:')\nfor interaction in detected_interactions[:3]: # Top 3\n print(f' • {interaction[\"protein_residue\"]} - {interaction[\"ligand_atom\"]} '\n f'({interaction[\"type\"].replace(\"_\", \" \")}): {interaction[\"distance\"]:.1f} Å')\n\n# Cleanup\nos.unlink(pdb_file)\nprint(f'\\nDemo complete - temporary files cleaned up')\n\nprint('\\nPLIP provides:')\nprint('• Automated protein-ligand interaction detection')\nprint('• Comprehensive interaction classification')\nprint('• 3D visualization and 2D diagrams')\nprint('• Binding site characterization')\nprint('• Drug discovery insights')\nprint('• Integration with molecular viewers')\nprint('• Batch processing capabilities')\nprint('• Command-line and Python API')\n\nprint('\\nCommon PLIP usage:')\nprint('Command line: plip -f complex.pdb -o output_folder')\nprint('Python API: Use PDBComplex and BindingSiteReport classes')",
|
|
680
|
+
"quick_start": [
|
|
681
|
+
"Install: pip install plip",
|
|
682
|
+
"Command line: plip -f protein_ligand.pdb -o results/",
|
|
683
|
+
"Python API: complex = PDBComplex(); complex.load_pdb('file.pdb')",
|
|
684
|
+
"Analyze: complex.analyze()",
|
|
685
|
+
"Report: BindingSiteReport(binding_site).generate_report()",
|
|
686
|
+
"View interactions in PyMOL or VMD"
|
|
687
|
+
]
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"type": "PackageTool",
|
|
692
|
+
"name": "get_pdbfixer_info",
|
|
693
|
+
"description": "Get comprehensive information about PDBFixer – protein structure preparation tool",
|
|
694
|
+
"parameter": {
|
|
695
|
+
"type": "object",
|
|
696
|
+
"properties": {
|
|
697
|
+
"info_type": {
|
|
698
|
+
"type": "string",
|
|
699
|
+
"enum": [
|
|
700
|
+
"overview",
|
|
701
|
+
"installation",
|
|
702
|
+
"usage",
|
|
703
|
+
"documentation"
|
|
704
|
+
],
|
|
705
|
+
"description": "Type of information to retrieve about PDBFixer"
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
"required": [
|
|
709
|
+
"info_type"
|
|
710
|
+
]
|
|
711
|
+
},
|
|
712
|
+
"package_name": "pdbfixer",
|
|
713
|
+
"local_info": {
|
|
714
|
+
"name": "PDBFixer",
|
|
715
|
+
"description": "Application for fixing common problems in Protein Data Bank (PDB) files. Automatically adds missing residues, atoms, and hydrogens while removing heterogens and water molecules for molecular dynamics simulations.",
|
|
716
|
+
"category": "Structural Biology / Protein Preparation",
|
|
717
|
+
"import_name": "pdbfixer",
|
|
718
|
+
"popularity": 75,
|
|
719
|
+
"keywords": [
|
|
720
|
+
"PDB",
|
|
721
|
+
"protein structure",
|
|
722
|
+
"missing atoms",
|
|
723
|
+
"structure preparation",
|
|
724
|
+
"molecular dynamics"
|
|
725
|
+
],
|
|
726
|
+
"documentation": "https://github.com/openmm/pdbfixer",
|
|
727
|
+
"repository": "https://github.com/openmm/pdbfixer",
|
|
728
|
+
"installation": {
|
|
729
|
+
"pip": "pip install pdbfixer",
|
|
730
|
+
"conda": "conda install -c conda-forge pdbfixer"
|
|
731
|
+
},
|
|
732
|
+
"usage_example": "from pdbfixer import PDBFixer\nfrom openmm.app import PDBFile\nimport os\n\n# Load PDB file\nfixer = PDBFixer(filename='input.pdb')\n\nprint(f'Original structure: {fixer.topology.getNumAtoms()} atoms')\nprint(f'Chains: {[chain.id for chain in fixer.topology.chains()]}')\n\n# Find and report problems\nfixer.findMissingResidues()\nfixer.findMissingAtoms()\nfixer.findNonstandardResidues()\n\nprint(f'Missing residues: {len(fixer.missingResidues)}')\nprint(f'Missing atoms: {len(fixer.missingAtoms)}')\nprint(f'Nonstandard residues: {len(fixer.nonstandardResidues)}')\n\n# Fix common problems\n# Remove heterogens (keep water)\nfixer.removeHeterogens(keepWater=True)\n\n# Add missing residues and atoms\nfixer.addMissingAtoms()\nfixer.addMissingHydrogens(7.0) # pH 7.0\n\nprint(f'Fixed structure: {fixer.topology.getNumAtoms()} atoms')\n\n# Save fixed structure\nPDBFile.writeFile(fixer.topology, fixer.positions, open('fixed.pdb', 'w'))\nprint('Saved fixed structure to fixed.pdb')\n\n# Alternative: Load from PDB ID\n# fixer = PDBFixer(pdbid='1YCR') # Downloads from PDB",
|
|
733
|
+
"quick_start": [
|
|
734
|
+
"Install: pip install pdbfixer",
|
|
735
|
+
"Load PDB: fixer = PDBFixer(filename='file.pdb')",
|
|
736
|
+
"Find problems: fixer.findMissingResidues/Atoms()",
|
|
737
|
+
"Remove heterogens: fixer.removeHeterogens()",
|
|
738
|
+
"Add missing atoms: fixer.addMissingAtoms()",
|
|
739
|
+
"Save result: PDBFile.writeFile()"
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"type": "PackageTool",
|
|
745
|
+
"name": "get_prody_info",
|
|
746
|
+
"description": "Get comprehensive information about ProDy – protein dynamics analysis",
|
|
747
|
+
"parameter": {
|
|
748
|
+
"type": "object",
|
|
749
|
+
"properties": {
|
|
750
|
+
"info_type": {
|
|
751
|
+
"type": "string",
|
|
752
|
+
"enum": [
|
|
753
|
+
"overview",
|
|
754
|
+
"installation",
|
|
755
|
+
"usage",
|
|
756
|
+
"documentation"
|
|
757
|
+
],
|
|
758
|
+
"description": "Type of information to retrieve about ProDy"
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
"required": [
|
|
762
|
+
"info_type"
|
|
763
|
+
]
|
|
764
|
+
},
|
|
765
|
+
"package_name": "prody",
|
|
766
|
+
"local_info": {
|
|
767
|
+
"name": "ProDy",
|
|
768
|
+
"description": "Python package for protein structural dynamics analysis. Provides tools for normal mode analysis, elastic network models, and conformational dynamics studies.",
|
|
769
|
+
"category": "Protein Dynamics / Structural Biology",
|
|
770
|
+
"import_name": "prody",
|
|
771
|
+
"popularity": 75,
|
|
772
|
+
"keywords": [
|
|
773
|
+
"protein dynamics",
|
|
774
|
+
"normal modes",
|
|
775
|
+
"elastic network",
|
|
776
|
+
"conformational analysis",
|
|
777
|
+
"PDB"
|
|
778
|
+
],
|
|
779
|
+
"documentation": "http://prody.csb.pitt.edu/",
|
|
780
|
+
"repository": "https://github.com/prody/ProDy",
|
|
781
|
+
"installation": {
|
|
782
|
+
"pip": "pip install prody",
|
|
783
|
+
"conda": "conda install -c conda-forge prody"
|
|
784
|
+
},
|
|
785
|
+
"usage_example": "import prody as pr\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tempfile\nimport os\nfrom io import StringIO\n\nprint('ProDy - Protein Structural Dynamics Analysis')\nprint('=' * 50)\n\n# Configure ProDy\npr.confProDy(verbosity='warning') # Reduce verbosity for demo\n\n# Create a synthetic protein structure for demonstration\nprint('Creating synthetic protein structure for ProDy analysis...')\n\n# Generate a simple beta-sheet structure\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.pdb', delete=False) as f:\n f.write('HEADER SYNTHETIC PROTEIN 01-SEP-25\\n')\n f.write('TITLE DEMONSTRATION PROTEIN FOR PRODY\\n')\n \n atom_id = 1\n res_id = 1\n \n # Create two beta strands\n for strand in range(2):\n for i in range(10): # 10 residues per strand\n if strand == 0:\n # First strand\n x = i * 3.5 # Extended conformation\n y = 0\n z = 0\n else:\n # Second strand (antiparallel)\n x = (9 - i) * 3.5 # Reverse direction\n y = 8 # Separated by ~8 Å\n z = 0\n \n # Add some variation\n x += np.random.normal(0, 0.1)\n y += np.random.normal(0, 0.1)\n z += np.random.normal(0, 0.1)\n \n res_name = 'VAL' if i % 2 == 0 else 'ILE'\n \n # Backbone atoms\n atoms = [\n ('N', x-0.5, y-0.3, z-0.1),\n ('CA', x, y, z),\n ('C', x+0.5, y+0.3, z+0.1),\n ('O', x+0.8, y+0.5, z+0.2)\n ]\n \n for atom_name, ax, ay, az in atoms:\n f.write(f'ATOM {atom_id:5d} {atom_name:4s}{res_name:>3s} A{res_id:4d} '\n f'{ax:8.3f}{ay:8.3f}{az:8.3f} 1.00 20.00 {atom_name[0]:>2s}\\n')\n atom_id += 1\n \n res_id += 1\n \n f.write('END\\n')\n pdb_file = f.name\n\nprint(f'Created synthetic PDB file: {pdb_file}')\n\n# Load structure with ProDy\nprint('\\n=== Loading Structure with ProDy ===')\n\ntry:\n # Parse PDB structure\n structure = pr.parsePDB(pdb_file)\n print(f'Structure loaded: {structure}')\n print(f'Number of atoms: {structure.numAtoms()}')\n print(f'Number of residues: {structure.numResidues()}')\n print(f'Number of chains: {structure.numChains()}')\n \n # Get atom information\n print(f'Atom names: {set(structure.getNames())}')\n print(f'Residue names: {set(structure.getResnames())}')\n \nexcept Exception as e:\n print(f'Error loading structure: {e}')\n # Create a simple structure manually for demonstration\n coords = np.random.random((80, 3)) * 20 # 80 atoms, 3D coordinates\n structure = pr.AtomGroup('demo')\n structure.setCoords(coords)\n structure.setNames(['CA'] * 80)\n structure.setResnames(['ALA'] * 80)\n structure.setResnums(np.repeat(range(1, 21), 4))\n print('Created synthetic AtomGroup for demonstration')\n\n# Basic structural analysis\nprint('\\n=== Basic Structural Analysis ===')\n\nif hasattr(structure, 'getCoords'):\n coords = structure.getCoords()\n print(f'Coordinate array shape: {coords.shape}')\n \n # Center of mass\n center_of_mass = coords.mean(axis=0)\n print(f'Center of mass: ({center_of_mass[0]:.2f}, {center_of_mass[1]:.2f}, {center_of_mass[2]:.2f})')\n \n # Calculate radius of gyration\n centered_coords = coords - center_of_mass\n rg = np.sqrt(np.mean(np.sum(centered_coords**2, axis=1)))\n print(f'Radius of gyration: {rg:.2f} Å')\n\n# Select specific atoms\nprint('\\n=== Atom Selection ===')\n\ntry:\n # Select backbone atoms\n backbone = structure.select('backbone')\n if backbone:\n print(f'Backbone atoms: {backbone.numAtoms()}')\n \n # Select CA atoms\n ca_atoms = structure.select('name CA')\n if ca_atoms:\n print(f'CA atoms: {ca_atoms.numAtoms()}')\n ca_coords = ca_atoms.getCoords()\n print(f'CA coordinate range:')\n print(f' X: {ca_coords[:, 0].min():.1f} to {ca_coords[:, 0].max():.1f} Å')\n print(f' Y: {ca_coords[:, 1].min():.1f} to {ca_coords[:, 1].max():.1f} Å')\n print(f' Z: {ca_coords[:, 2].min():.1f} to {ca_coords[:, 2].max():.1f} Å')\n \nexcept Exception as e:\n print(f'Selection error: {e}')\n # Use all atoms as CA atoms for demo\n ca_atoms = structure\n ca_coords = structure.getCoords()\n\n# Elastic Network Model (ENM)\nprint('\\n=== Elastic Network Model Analysis ===')\n\ntry:\n # Create Gaussian Network Model\n if ca_atoms and ca_atoms.numAtoms() > 3:\n print('Building Gaussian Network Model (GNM)...')\n gnm = pr.GNM('GNM Analysis')\n gnm.buildKirchhoff(ca_atoms, cutoff=10.0) # 10 Å cutoff\n \n print(f'GNM Kirchhoff matrix shape: {gnm.getKirchhoff().shape}')\n \n # Calculate normal modes\n print('Calculating normal modes...')\n gnm.calcModes(n_modes=10) # Calculate first 10 modes\n \n print(f'Number of modes calculated: {gnm.numModes()}')\n print(f'Eigenvalues (first 5): {gnm.getEigvals()[:5]}')\n \n # Get mode information\n mode_data = []\n for i in range(min(5, gnm.numModes())):\n eigenval = gnm.getEigvals()[i]\n mode_data.append({\n 'mode': i + 1,\n 'eigenvalue': eigenval,\n 'frequency': np.sqrt(eigenval) if eigenval > 0 else 0\n })\n \n print('\\nMode analysis:')\n for data in mode_data:\n print(f' Mode {data[\"mode\"]}: eigenvalue = {data[\"eigenvalue\"]:.6f}, '\n f'frequency = {data[\"frequency\"]:.6f}')\n \nexcept Exception as e:\n print(f'ENM analysis error: {e}')\n # Create synthetic mode data\n mode_data = [\n {'mode': i+1, 'eigenvalue': np.random.random()*0.1, 'frequency': np.random.random()*0.3}\n for i in range(5)\n ]\n print('Created synthetic mode data for demonstration')\n\n# Anisotropic Network Model (ANM)\nprint('\\n=== Anisotropic Network Model Analysis ===')\n\ntry:\n if ca_atoms and ca_atoms.numAtoms() > 3:\n print('Building Anisotropic Network Model (ANM)...')\n anm = pr.ANM('ANM Analysis')\n anm.buildHessian(ca_atoms, cutoff=15.0) # 15 Å cutoff\n \n print(f'ANM Hessian matrix shape: {anm.getHessian().shape}')\n \n # Calculate normal modes\n anm.calcModes(n_modes=10)\n \n print(f'Number of ANM modes: {anm.numModes()}')\n \n # Calculate mean square fluctuations\n if anm.numModes() > 0:\n msf = pr.calcSqFlucts(anm)\n print(f'Mean square fluctuations calculated: {len(msf)} residues')\n print(f'MSF range: {msf.min():.4f} to {msf.max():.4f} Ų')\n print(f'Average MSF: {msf.mean():.4f} Ų')\n \n # Mode analysis\n anm_mode_data = []\n for i in range(min(5, anm.numModes())):\n eigenval = anm.getEigvals()[i]\n anm_mode_data.append({\n 'mode': i + 1,\n 'eigenvalue': eigenval,\n 'frequency': np.sqrt(eigenval) if eigenval > 0 else 0\n })\n \n print('\\nANM mode analysis:')\n for data in anm_mode_data:\n print(f' Mode {data[\"mode\"]}: eigenvalue = {data[\"eigenvalue\"]:.6f}')\n \nexcept Exception as e:\n print(f'ANM analysis error: {e}')\n # Create synthetic data\n msf = np.random.random(20) * 2.0\n anm_mode_data = mode_data.copy()\n print('Created synthetic ANM data for demonstration')\n\n# B-factor analysis\nprint('\\n=== B-factor Analysis ===')\n\ntry:\n # Calculate theoretical B-factors from ENM\n if 'anm' in locals() and anm.numModes() > 0:\n bfactors = pr.calcTempFactors(anm, ca_atoms)\n print(f'Calculated B-factors: {len(bfactors)} atoms')\n print(f'B-factor range: {bfactors.min():.2f} to {bfactors.max():.2f} Ų')\n print(f'Average B-factor: {bfactors.mean():.2f} Ų')\n else:\n # Synthetic B-factors\n bfactors = np.random.random(20) * 50 + 10\n print('Created synthetic B-factors for demonstration')\n \n # Compare with experimental (if available)\n if hasattr(structure, 'getBetas'):\n exp_bfactors = structure.getBetas()\n if exp_bfactors is not None and len(exp_bfactors) > 0:\n correlation = np.corrcoef(bfactors[:len(exp_bfactors)], exp_bfactors)[0, 1]\n print(f'Correlation with experimental B-factors: {correlation:.3f}')\n else:\n print('No experimental B-factors available')\n \nexcept Exception as e:\n print(f'B-factor analysis error: {e}')\n bfactors = np.random.random(20) * 50 + 10\n\n# Cross-correlation analysis\nprint('\\n=== Cross-correlation Analysis ===')\n\ntry:\n if 'anm' in locals() and anm.numModes() > 0:\n # Calculate cross-correlations\n cross_corr = pr.calcCrossCorr(anm)\n print(f'Cross-correlation matrix shape: {cross_corr.shape}')\n print(f'Correlation range: {cross_corr.min():.3f} to {cross_corr.max():.3f}')\n \n # Average correlation\n # Exclude diagonal elements\n off_diagonal = cross_corr[np.triu_indices_from(cross_corr, k=1)]\n avg_correlation = off_diagonal.mean()\n print(f'Average off-diagonal correlation: {avg_correlation:.3f}')\n else:\n # Synthetic correlation matrix\n n = 20\n cross_corr = np.random.random((n, n))\n cross_corr = (cross_corr + cross_corr.T) / 2 # Make symmetric\n np.fill_diagonal(cross_corr, 1.0)\n print('Created synthetic cross-correlation matrix')\n \nexcept Exception as e:\n print(f'Cross-correlation analysis error: {e}')\n n = 20\n cross_corr = np.eye(n) + np.random.random((n, n)) * 0.5\n\n# Visualization\nprint('\\n=== Visualization ===')\n\nfig, axes = plt.subplots(2, 2, figsize=(12, 10))\n\n# 1. Mode eigenvalues\nif 'mode_data' in locals():\n modes = [d['mode'] for d in mode_data]\n eigenvals = [d['eigenvalue'] for d in mode_data]\n axes[0, 0].bar(modes, eigenvals, color='skyblue')\n axes[0, 0].set_xlabel('Mode Number')\n axes[0, 0].set_ylabel('Eigenvalue')\n axes[0, 0].set_title('Normal Mode Eigenvalues')\n axes[0, 0].grid(True, alpha=0.3)\n\n# 2. Mean square fluctuations\nif 'msf' in locals():\n residue_indices = np.arange(1, len(msf) + 1)\n axes[0, 1].plot(residue_indices, msf, 'o-', color='red')\n axes[0, 1].set_xlabel('Residue Number')\n axes[0, 1].set_ylabel('Mean Square Fluctuation (Ų)')\n axes[0, 1].set_title('Residue Flexibility')\n axes[0, 1].grid(True, alpha=0.3)\n\n# 3. B-factors\nif 'bfactors' in locals():\n residue_indices = np.arange(1, len(bfactors) + 1)\n axes[1, 0].plot(residue_indices, bfactors, 's-', color='green')\n axes[1, 0].set_xlabel('Residue Number')\n axes[1, 0].set_ylabel('B-factor (Ų)')\n axes[1, 0].set_title('Theoretical B-factors')\n axes[1, 0].grid(True, alpha=0.3)\n\n# 4. Cross-correlation matrix\nif 'cross_corr' in locals():\n im = axes[1, 1].imshow(cross_corr, cmap='RdBu_r', vmin=-1, vmax=1)\n axes[1, 1].set_xlabel('Residue Number')\n axes[1, 1].set_ylabel('Residue Number')\n axes[1, 1].set_title('Cross-correlation Matrix')\n plt.colorbar(im, ax=axes[1, 1], label='Correlation')\n\nplt.tight_layout()\n\n# Save visualization\nwith tempfile.NamedTemporaryFile(suffix='.png', delete=False) as tmp:\n plt.savefig(tmp.name, dpi=150, bbox_inches='tight')\n viz_file = tmp.name\n\nplt.close()\nprint(f'Analysis visualization saved to: {viz_file}')\n\n# Summary report\nprint('\\n' + '=' * 50)\nprint('PRODY PROTEIN DYNAMICS ANALYSIS SUMMARY')\nprint('=' * 50)\nif 'structure' in locals():\n print(f'Structure: {structure.numAtoms()} atoms, {structure.numResidues()} residues')\nif 'rg' in locals():\n print(f'Radius of gyration: {rg:.2f} Å')\nif 'mode_data' in locals():\n print(f'Normal modes calculated: {len(mode_data)}')\n print(f'Lowest frequency mode eigenvalue: {mode_data[0][\"eigenvalue\"]:.6f}')\nif 'msf' in locals():\n print(f'Average residue flexibility: {msf.mean():.3f} Ų')\n print(f'Most flexible residue: {np.argmax(msf)+1} (MSF = {msf.max():.3f} Ų)')\nif 'bfactors' in locals():\n print(f'Average theoretical B-factor: {bfactors.mean():.2f} Ų')\nif 'cross_corr' in locals():\n off_diag = cross_corr[np.triu_indices_from(cross_corr, k=1)]\n print(f'Average residue correlation: {off_diag.mean():.3f}')\n\n# Cleanup\nos.unlink(pdb_file)\nos.unlink(viz_file)\nprint('\\nDemo complete - temporary files cleaned up')\n\nprint('\\nProDy provides:')\nprint('• Elastic network models (GNM, ANM)')\nprint('• Normal mode analysis')\nprint('• Protein dynamics calculations')\nprint('• B-factor prediction')\nprint('• Cross-correlation analysis')\nprint('• Ensemble analysis')\nprint('• PDB file manipulation')\nprint('• Integration with VMD and PyMOL')",
|
|
786
|
+
"quick_start": [
|
|
787
|
+
"Install: pip install prody",
|
|
788
|
+
"Load PDB: structure = prody.parsePDB('1xyz')",
|
|
789
|
+
"Select atoms: ca = structure.select('name CA')",
|
|
790
|
+
"Build ANM: anm = prody.ANM(); anm.buildHessian(ca)",
|
|
791
|
+
"Calculate modes: anm.calcModes()",
|
|
792
|
+
"Get B-factors: bfactors = prody.calcTempFactors(anm)"
|
|
793
|
+
]
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"type": "PackageTool",
|
|
798
|
+
"name": "get_mageck_info",
|
|
799
|
+
"description": "Get comprehensive information about MAGeCK – CRISPR screen analysis toolkit",
|
|
800
|
+
"parameter": {
|
|
801
|
+
"type": "object",
|
|
802
|
+
"properties": {
|
|
803
|
+
"info_type": {
|
|
804
|
+
"type": "string",
|
|
805
|
+
"enum": [
|
|
806
|
+
"overview",
|
|
807
|
+
"installation",
|
|
808
|
+
"usage",
|
|
809
|
+
"documentation"
|
|
810
|
+
],
|
|
811
|
+
"description": "Type of information to retrieve about MAGeCK"
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
"required": [
|
|
815
|
+
"info_type"
|
|
816
|
+
]
|
|
817
|
+
},
|
|
818
|
+
"package_name": "mageck",
|
|
819
|
+
"local_info": {
|
|
820
|
+
"name": "MAGeCK",
|
|
821
|
+
"description": "Model-based Analysis of Genome-wide CRISPR-Cas9 Knockout (MAGeCK) for identifying essential and non-essential genes from CRISPR screening experiments. Provides robust statistical methods for hit identification.",
|
|
822
|
+
"category": "CRISPR Analysis",
|
|
823
|
+
"import_name": "mageck",
|
|
824
|
+
"popularity": 80,
|
|
825
|
+
"keywords": [
|
|
826
|
+
"CRISPR",
|
|
827
|
+
"genome editing",
|
|
828
|
+
"genetic screens",
|
|
829
|
+
"gene essentiality",
|
|
830
|
+
"sgRNA"
|
|
831
|
+
],
|
|
832
|
+
"documentation": "https://sourceforge.net/p/mageck/wiki/Home/",
|
|
833
|
+
"repository": "https://github.com/liulab-dfci/MAGeCK",
|
|
834
|
+
"installation": {
|
|
835
|
+
"pip": "pip install mageck",
|
|
836
|
+
"conda": "conda install -c bioconda mageck"
|
|
837
|
+
},
|
|
838
|
+
"usage_example": "# MAGeCK is primarily used as command-line tool\n# Python interface available for programmatic access\n\nimport subprocess\nimport pandas as pd\n\n# Example MAGeCK workflow (typically run from command line):\n\n# 1. Count sgRNA reads\n# mageck count -l library.txt -n sample --sample-label day0,day23 \n# --fastq day0.fastq day23.fastq\n\n# 2. Test for essential genes\n# mageck test -k sample.count.txt -t day23 -c day0 -n essential_genes\n\n# 3. Maximum Likelihood Estimation (MLE) for time course\n# mageck mle -k sample.count.txt -d design_matrix.txt -n timecourse\n\n# Read MAGeCK results\nresults = pd.read_csv('essential_genes.gene_summary.txt', sep='\\t')\nprint('Top 10 essential genes:')\nprint(results.head(10)[['id', 'neg|score', 'neg|p-value', 'neg|fdr']])\n\n# Visualize results\nimport matplotlib.pyplot as plt\nplt.scatter(results['neg|score'], -np.log10(results['neg|p-value']))\nplt.xlabel('Gene Score')\nplt.ylabel('-log10(p-value)')\nplt.title('MAGeCK Results: Gene Essentiality')\nplt.show()",
|
|
839
|
+
"quick_start": [
|
|
840
|
+
"Install: pip install mageck",
|
|
841
|
+
"Prepare sgRNA library file",
|
|
842
|
+
"Count reads: mageck count -l library.txt --fastq files",
|
|
843
|
+
"Test essentiality: mageck test -k counts.txt",
|
|
844
|
+
"Use MLE for complex designs: mageck mle",
|
|
845
|
+
"Analyze results with pandas/matplotlib"
|
|
846
|
+
]
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"type": "PackageTool",
|
|
851
|
+
"name": "get_flowkit_info",
|
|
852
|
+
"description": "Get comprehensive information about FlowKit – flow cytometry analysis toolkit",
|
|
853
|
+
"parameter": {
|
|
854
|
+
"type": "object",
|
|
855
|
+
"properties": {
|
|
856
|
+
"info_type": {
|
|
857
|
+
"type": "string",
|
|
858
|
+
"enum": [
|
|
859
|
+
"overview",
|
|
860
|
+
"installation",
|
|
861
|
+
"usage",
|
|
862
|
+
"documentation"
|
|
863
|
+
],
|
|
864
|
+
"description": "Type of information to retrieve about FlowKit"
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
"required": [
|
|
868
|
+
"info_type"
|
|
869
|
+
]
|
|
870
|
+
},
|
|
871
|
+
"package_name": "flowkit",
|
|
872
|
+
"local_info": {
|
|
873
|
+
"name": "FlowKit",
|
|
874
|
+
"description": "Comprehensive toolkit for flow cytometry data analysis in Python. Provides functions for data import, compensation, transformation, gating, and visualization of flow cytometry experiments.",
|
|
875
|
+
"category": "Flow Cytometry",
|
|
876
|
+
"import_name": "flowkit",
|
|
877
|
+
"popularity": 65,
|
|
878
|
+
"keywords": [
|
|
879
|
+
"flow cytometry",
|
|
880
|
+
"cell analysis",
|
|
881
|
+
"gating",
|
|
882
|
+
"compensation",
|
|
883
|
+
"immunology",
|
|
884
|
+
"cell sorting"
|
|
885
|
+
],
|
|
886
|
+
"documentation": "https://flowkit.readthedocs.io/",
|
|
887
|
+
"repository": "https://github.com/whitews/FlowKit",
|
|
888
|
+
"installation": {
|
|
889
|
+
"pip": "pip install flowkit",
|
|
890
|
+
"conda": "conda install -c conda-forge flowkit"
|
|
891
|
+
},
|
|
892
|
+
"usage_example": "import flowkit as fk\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Load FCS file\nsample = fk.Sample('sample.fcs')\nprint(f'Events: {sample.event_count}')\nprint(f'Channels: {len(sample.channels)}')\nprint(f'Channel names: {[ch.pnn_label for ch in sample.channels]}')\n\n# Apply compensation (if available)\nif sample.metadata.get('spill'):\n sample.apply_compensation()\n print('Applied compensation matrix')\n\n# Apply transforms (e.g., logicle)\nsample.apply_transform('logicle')\n\n# Create gates\nfrom flowkit import gates\n\n# Polygon gate example\nvertices = [(100, 200), (400, 200), (400, 500), (100, 500)]\npoly_gate = gates.PolygonGate('PolyGate', channels=['FSC-A', 'SSC-A'], vertices=vertices)\n\n# Apply gate\ngated_events = sample.get_events(gate=poly_gate)\nprint(f'Events after gating: {len(gated_events)}')\n\n# Plot data\nfig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))\n\n# Original data\nax1.scatter(sample.get_events()[:, 0], sample.get_events()[:, 1], alpha=0.3)\nax1.set_title('Original Data')\nax1.set_xlabel('FSC-A')\nax1.set_ylabel('SSC-A')\n\n# Gated data\nax2.scatter(gated_events[:, 0], gated_events[:, 1], alpha=0.3)\nax2.set_title('Gated Data')\nax2.set_xlabel('FSC-A')\nax2.set_ylabel('SSC-A')\n\nplt.tight_layout()\nplt.show()",
|
|
893
|
+
"quick_start": [
|
|
894
|
+
"Install: pip install flowkit",
|
|
895
|
+
"Load FCS file: sample = fk.Sample('file.fcs')",
|
|
896
|
+
"Apply compensation: sample.apply_compensation()",
|
|
897
|
+
"Transform data: sample.apply_transform('logicle')",
|
|
898
|
+
"Create gates: gates.PolygonGate() or gates.RectangleGate()",
|
|
899
|
+
"Analyze gated events: sample.get_events(gate=gate)"
|
|
900
|
+
]
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"type": "PackageTool",
|
|
905
|
+
"name": "get_poliastro_info",
|
|
906
|
+
"description": "Get comprehensive information about poliastro – astrodynamics library",
|
|
907
|
+
"parameter": {
|
|
908
|
+
"type": "object",
|
|
909
|
+
"properties": {
|
|
910
|
+
"info_type": {
|
|
911
|
+
"type": "string",
|
|
912
|
+
"enum": [
|
|
913
|
+
"overview",
|
|
914
|
+
"installation",
|
|
915
|
+
"usage",
|
|
916
|
+
"documentation"
|
|
917
|
+
],
|
|
918
|
+
"description": "Type of information to retrieve about poliastro"
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
"required": [
|
|
922
|
+
"info_type"
|
|
923
|
+
]
|
|
924
|
+
},
|
|
925
|
+
"package_name": "poliastro",
|
|
926
|
+
"local_info": {
|
|
927
|
+
"name": "poliastro",
|
|
928
|
+
"description": "Astrodynamics in Python. Pure Python library for orbital mechanics computations including orbit determination, propagation, maneuvers, and space mission analysis.",
|
|
929
|
+
"category": "Scientific Computing / Aerospace",
|
|
930
|
+
"import_name": "poliastro",
|
|
931
|
+
"popularity": 65,
|
|
932
|
+
"keywords": [
|
|
933
|
+
"astrodynamics",
|
|
934
|
+
"orbital mechanics",
|
|
935
|
+
"space",
|
|
936
|
+
"satellites",
|
|
937
|
+
"mission planning"
|
|
938
|
+
],
|
|
939
|
+
"documentation": "https://docs.poliastro.space/",
|
|
940
|
+
"repository": "https://github.com/poliastro/poliastro",
|
|
941
|
+
"installation": {
|
|
942
|
+
"pip": "pip install poliastro",
|
|
943
|
+
"conda": "conda install -c conda-forge poliastro"
|
|
944
|
+
},
|
|
945
|
+
"usage_example": "# poliastro astrodynamics simulation\n# This demonstrates orbital mechanics concepts\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport tempfile\nimport os\nfrom datetime import datetime, timedelta\n\nprint('poliastro - Astrodynamics in Python')\nprint('=' * 38)\n\nprint('poliastro Features:')\nprint('• Orbital mechanics computations')\nprint('• Orbit propagation and determination')\nprint('• Maneuver planning and optimization')\nprint('• Two-body and n-body problems')\nprint('• Coordinate transformations')\nprint('• Mission analysis tools')\nprint('• Integration with astronomy libraries')\n\nprint('\\nApplications:')\nprint('• Satellite mission planning')\nprint('• Spacecraft trajectory design')\nprint('• Orbit analysis and visualization')\nprint('• Interplanetary mission design')\nprint('• Space situational awareness')\n\n# Constants (approximate values)\nprint('\\n=== Astronomical Constants ===')\n\n# Gravitational parameters (km³/s²)\nGM_earth = 398600.4418 # Earth\nGM_sun = 1.32712442018e11 # Sun\nGM_moon = 4902.7779 # Moon\n\n# Planetary radii (km)\nR_earth = 6378.137\nR_sun = 695700\nR_moon = 1737.1\n\n# Orbital elements for demonstration\nprint(f'Earth gravitational parameter: {GM_earth:.1f} km³/s²')\nprint(f'Earth radius: {R_earth:.1f} km')\nprint(f'Sun gravitational parameter: {GM_sun:.2e} km³/s²')\n\n# Define orbital elements\nprint('\\n=== Orbital Elements ===')\n\n# Example orbit: International Space Station (ISS)\niss_elements = {\n 'semi_major_axis': 6793.0, # km\n 'eccentricity': 0.0003,\n 'inclination': 51.6, # degrees\n 'raan': 150.0, # Right Ascension of Ascending Node (degrees)\n 'arg_periapsis': 90.0, # Argument of periapsis (degrees)\n 'true_anomaly': 0.0 # degrees\n}\n\nprint('ISS-like orbit:')\nfor element, value in iss_elements.items():\n print(f' {element}: {value}')\n\n# Convert angles to radians\niss_elements_rad = iss_elements.copy()\nfor angle in ['inclination', 'raan', 'arg_periapsis', 'true_anomaly']:\n iss_elements_rad[angle] = np.radians(iss_elements[angle])\n\n# Orbital mechanics functions\ndef orbital_elements_to_cartesian(elements, mu):\n \"\"\"Convert orbital elements to Cartesian coordinates\"\"\"\n a = elements['semi_major_axis']\n e = elements['eccentricity']\n i = elements['inclination']\n raan = elements['raan']\n w = elements['arg_periapsis']\n nu = elements['true_anomaly']\n \n # Semi-latus rectum\n p = a * (1 - e**2)\n \n # Distance\n r = p / (1 + e * np.cos(nu))\n \n # Position in orbital plane\n x_orb = r * np.cos(nu)\n y_orb = r * np.sin(nu)\n z_orb = 0\n \n # Velocity in orbital plane\n h = np.sqrt(mu * p) # Angular momentum\n vx_orb = -(mu / h) * np.sin(nu)\n vy_orb = (mu / h) * (e + np.cos(nu))\n vz_orb = 0\n \n # Rotation matrices\n cos_raan = np.cos(raan)\n sin_raan = np.sin(raan)\n cos_i = np.cos(i)\n sin_i = np.sin(i)\n cos_w = np.cos(w)\n sin_w = np.sin(w)\n \n # Rotation matrix from orbital plane to inertial frame\n R11 = cos_raan * cos_w - sin_raan * sin_w * cos_i\n R12 = -cos_raan * sin_w - sin_raan * cos_w * cos_i\n R13 = sin_raan * sin_i\n \n R21 = sin_raan * cos_w + cos_raan * sin_w * cos_i\n R22 = -sin_raan * sin_w + cos_raan * cos_w * cos_i\n R23 = -cos_raan * sin_i\n \n R31 = sin_w * sin_i\n R32 = cos_w * sin_i\n R33 = cos_i\n \n # Transform to inertial frame\n x = R11 * x_orb + R12 * y_orb + R13 * z_orb\n y = R21 * x_orb + R22 * y_orb + R23 * z_orb\n z = R31 * x_orb + R32 * y_orb + R33 * z_orb\n \n vx = R11 * vx_orb + R12 * vy_orb + R13 * vz_orb\n vy = R21 * vx_orb + R22 * vy_orb + R23 * vz_orb\n vz = R31 * vx_orb + R32 * vy_orb + R33 * vz_orb\n \n return np.array([x, y, z]), np.array([vx, vy, vz])\n\ndef propagate_orbit(r0, v0, mu, dt):\n \"\"\"Propagate orbit using universal variables (simplified)\"\"\"\n # This is a simplified version - real implementation would be more complex\n r0_mag = np.linalg.norm(r0)\n v0_mag = np.linalg.norm(v0)\n \n # Specific energy\n energy = v0_mag**2 / 2 - mu / r0_mag\n \n # Semi-major axis\n if energy < 0: # Elliptical orbit\n a = -mu / (2 * energy)\n \n # Mean motion\n n = np.sqrt(mu / a**3)\n \n # Simple Keplerian propagation (circular approximation)\n theta = n * dt\n \n # Rotation matrix for circular orbit approximation\n cos_theta = np.cos(theta)\n sin_theta = np.sin(theta)\n \n # Simplified rotation (assumes orbit in xy-plane)\n r_new = np.array([\n cos_theta * r0[0] + sin_theta * r0[1],\n -sin_theta * r0[0] + cos_theta * r0[1],\n r0[2]\n ])\n \n v_new = np.array([\n cos_theta * v0[0] + sin_theta * v0[1],\n -sin_theta * v0[0] + cos_theta * v0[1],\n v0[2]\n ])\n else:\n # Hyperbolic or parabolic - just return original for simplicity\n r_new = r0\n v_new = v0\n \n return r_new, v_new\n\ndef calculate_orbital_period(a, mu):\n \"\"\"Calculate orbital period using Kepler's third law\"\"\"\n return 2 * np.pi * np.sqrt(a**3 / mu)\n\ndef hohmann_transfer(r1, r2, mu):\n \"\"\"Calculate Hohmann transfer orbit\"\"\"\n # Semi-major axis of transfer orbit\n a_transfer = (r1 + r2) / 2\n \n # Velocities\n v1_circular = np.sqrt(mu / r1)\n v2_circular = np.sqrt(mu / r2)\n \n # Transfer orbit velocities\n v1_transfer = np.sqrt(mu * (2/r1 - 1/a_transfer))\n v2_transfer = np.sqrt(mu * (2/r2 - 1/a_transfer))\n \n # Delta-v requirements\n dv1 = v1_transfer - v1_circular\n dv2 = v2_circular - v2_transfer\n \n # Transfer time\n t_transfer = np.pi * np.sqrt(a_transfer**3 / mu)\n \n return {\n 'delta_v1': dv1,\n 'delta_v2': dv2,\n 'total_delta_v': abs(dv1) + abs(dv2),\n 'transfer_time': t_transfer,\n 'a_transfer': a_transfer\n }\n\n# Orbital calculations\nprint('\\n=== Orbital Calculations ===')\n\n# Convert orbital elements to Cartesian\nr0, v0 = orbital_elements_to_cartesian(iss_elements_rad, GM_earth)\nprint(f'Initial position: [{r0[0]:.1f}, {r0[1]:.1f}, {r0[2]:.1f}] km')\nprint(f'Initial velocity: [{v0[0]:.3f}, {v0[1]:.3f}, {v0[2]:.3f}] km/s')\n\n# Calculate orbital properties\na = iss_elements['semi_major_axis']\ne = iss_elements['eccentricity']\n\nperiod = calculate_orbital_period(a, GM_earth)\nperiapsis = a * (1 - e) - R_earth\napoapsis = a * (1 + e) - R_earth\n\nprint(f'\\nOrbital properties:')\nprint(f' Period: {period/3600:.2f} hours')\nprint(f' Periapsis altitude: {periapsis:.1f} km')\nprint(f' Apoapsis altitude: {apoapsis:.1f} km')\nprint(f' Orbital velocity: {np.linalg.norm(v0):.3f} km/s')\n\n# Orbit propagation\nprint('\\n=== Orbit Propagation ===')\n\n# Propagate orbit for one complete period\nn_points = 100\ntime_steps = np.linspace(0, period, n_points)\n\norbit_positions = []\norbit_velocities = []\n\nfor dt in time_steps:\n r, v = propagate_orbit(r0, v0, GM_earth, dt)\n orbit_positions.append(r)\n orbit_velocities.append(v)\n\norbit_positions = np.array(orbit_positions)\norbit_velocities = np.array(orbit_velocities)\n\nprint(f'Propagated orbit for {period/3600:.2f} hours')\nprint(f'Generated {n_points} orbital positions')\n\n# Calculate ground track (simplified)\nprint('\\n=== Ground Track Calculation ===')\n\n# Earth rotation rate (rad/s)\nearth_rotation_rate = 7.2921159e-5\n\n# Calculate longitude drift due to Earth rotation\nlongitudes = []\nlatitudes = []\n\nfor i, (r, t) in enumerate(zip(orbit_positions, time_steps)):\n # Convert to latitude/longitude (simplified)\n x, y, z = r\n \n # Latitude\n lat = np.degrees(np.arcsin(z / np.linalg.norm(r)))\n \n # Longitude (accounting for Earth rotation)\n lon = np.degrees(np.arctan2(y, x)) - np.degrees(earth_rotation_rate * t)\n \n # Normalize longitude to [-180, 180]\n while lon > 180:\n lon -= 360\n while lon < -180:\n lon += 360\n \n latitudes.append(lat)\n longitudes.append(lon)\n\nprint(f'Ground track covers latitudes: {min(latitudes):.1f}° to {max(latitudes):.1f}°')\nprint(f'Longitude range: {min(longitudes):.1f}° to {max(longitudes):.1f}°')\n\n# Mission planning: Hohmann transfer\nprint('\\n=== Mission Planning: Hohmann Transfer ===')\n\n# Transfer from ISS orbit to geostationary orbit\nr_iss = a # ISS semi-major axis\nr_geo = 42164 # Geostationary orbit radius (km)\n\ntransfer = hohmann_transfer(r_iss, r_geo, GM_earth)\n\nprint(f'Hohmann transfer from ISS to GEO:')\nprint(f' First burn (ΔV₁): {transfer[\"delta_v1\"]:.3f} km/s')\nprint(f' Second burn (ΔV₂): {transfer[\"delta_v2\"]:.3f} km/s')\nprint(f' Total ΔV: {transfer[\"total_delta_v\"]:.3f} km/s')\nprint(f' Transfer time: {transfer[\"transfer_time\"]/3600:.2f} hours')\n\n# Interplanetary mission example\nprint('\\n=== Interplanetary Mission: Earth to Mars ===')\n\n# Simplified Earth-Mars transfer\n# Average orbital radii (AU converted to km)\nAU = 149597870.7 # km\nr_earth_orbit = 1.0 * AU\nr_mars_orbit = 1.52 * AU\n\n# Hohmann transfer to Mars\nmars_transfer = hohmann_transfer(r_earth_orbit, r_mars_orbit, GM_sun)\n\nprint(f'Earth to Mars Hohmann transfer:')\nprint(f' ΔV at Earth departure: {mars_transfer[\"delta_v1\"]:.2f} km/s')\nprint(f' ΔV at Mars arrival: {mars_transfer[\"delta_v2\"]:.2f} km/s')\nprint(f' Total ΔV: {mars_transfer[\"total_delta_v\"]:.2f} km/s')\nprint(f' Transfer time: {mars_transfer[\"transfer_time\"]/(24*3600):.0f} days')\n\n# Orbital perturbations analysis\nprint('\\n=== Orbital Perturbations ===')\n\n# J2 perturbation (Earth oblateness)\nJ2 = 1.08262668e-3 # Earth's J2 coefficient\n\ndef j2_perturbation_rates(a, e, i):\n \"\"\"Calculate secular rates due to J2 perturbation\"\"\"\n n = np.sqrt(GM_earth / a**3) # Mean motion\n \n # Rate of change of RAAN (rad/s)\n raan_dot = -1.5 * n * J2 * (R_earth/a)**2 * np.cos(i) / (1 - e**2)**2\n \n # Rate of change of argument of periapsis (rad/s)\n w_dot = 0.75 * n * J2 * (R_earth/a)**2 * (5*np.cos(i)**2 - 1) / (1 - e**2)**2\n \n return raan_dot, w_dot\n\ni_rad = np.radians(iss_elements['inclination'])\nraan_dot, w_dot = j2_perturbation_rates(a, e, i_rad)\n\nprint(f'J2 perturbation effects (ISS orbit):')\nprint(f' RAAN precession: {np.degrees(raan_dot)*86400:.3f} deg/day')\nprint(f' Periapsis rotation: {np.degrees(w_dot)*86400:.3f} deg/day')\n\n# Solar radiation pressure (simplified)\narea_to_mass = 0.01 # m²/kg (typical for satellites)\nsolar_flux = 1361 # W/m² (solar constant)\nspeed_of_light = 299792458 # m/s\n\nsolar_pressure = solar_flux / speed_of_light # N/m²\naccel_srp = solar_pressure * area_to_mass * 1e-3 # km/s² (very small)\n\nprint(f'\\nSolar radiation pressure:')\nprint(f' Pressure: {solar_pressure*1e6:.2f} μN/m²')\nprint(f' Acceleration (A/m=0.01): {accel_srp*1e9:.2f} nm/s²')\n\n# Atmospheric drag (simplified)\naltitude = periapsis # km\n\n# Simplified atmospheric density model\nif altitude < 200:\n density = 2.8e-11 # kg/m³\nelif altitude < 300:\n density = 1.7e-12\nelif altitude < 400:\n density = 2.8e-13\nelif altitude < 500:\n density = 7.2e-14\nelse:\n density = 2.4e-14\n\ncd = 2.2 # Drag coefficient\nvelocity = np.linalg.norm(v0) * 1000 # m/s\naccel_drag = 0.5 * density * cd * area_to_mass * velocity**2 * 1e-3 # km/s²\n\nprint(f'\\nAtmospheric drag:')\nprint(f' Altitude: {altitude:.1f} km')\nprint(f' Density: {density:.2e} kg/m³')\nprint(f' Drag acceleration: {accel_drag*1e9:.2f} nm/s²')\n\n# Visualization\nprint('\\n=== Visualization ===')\n\nfig = plt.figure(figsize=(16, 12))\n\n# 3D orbit visualization\nax1 = fig.add_subplot(221, projection='3d')\n\n# Plot Earth\nu = np.linspace(0, 2 * np.pi, 50)\nv = np.linspace(0, np.pi, 50)\nearth_x = R_earth * np.outer(np.cos(u), np.sin(v))\nearth_y = R_earth * np.outer(np.sin(u), np.sin(v))\nearth_z = R_earth * np.outer(np.ones(np.size(u)), np.cos(v))\nax1.plot_surface(earth_x, earth_y, earth_z, alpha=0.3, color='blue')\n\n# Plot orbit\nax1.plot(orbit_positions[:, 0], orbit_positions[:, 1], orbit_positions[:, 2], \n 'r-', linewidth=2, label='Orbit')\n\n# Plot initial position\nax1.scatter(*r0, color='green', s=100, label='Initial position')\n\nax1.set_xlabel('X (km)')\nax1.set_ylabel('Y (km)')\nax1.set_zlabel('Z (km)')\nax1.set_title('3D Orbital Trajectory')\nax1.legend()\n\n# Set equal aspect ratio\nmax_range = np.max(orbit_positions) * 1.1\nax1.set_xlim(-max_range, max_range)\nax1.set_ylim(-max_range, max_range)\nax1.set_zlim(-max_range, max_range)\n\n# Ground track\nax2 = fig.add_subplot(222)\nax2.plot(longitudes, latitudes, 'b-', linewidth=2, alpha=0.7)\nax2.scatter(longitudes[0], latitudes[0], color='green', s=100, label='Start')\nax2.scatter(longitudes[-1], latitudes[-1], color='red', s=100, label='End')\nax2.set_xlabel('Longitude (degrees)')\nax2.set_ylabel('Latitude (degrees)')\nax2.set_title('Ground Track')\nax2.grid(True, alpha=0.3)\nax2.legend()\n\n# Add world map outline (simplified)\nax2.axhline(y=0, color='k', linestyle='-', alpha=0.3) # Equator\nax2.axvline(x=0, color='k', linestyle='-', alpha=0.3) # Prime meridian\nax2.set_xlim(-180, 180)\nax2.set_ylim(-90, 90)\n\n# Orbital elements evolution (with perturbations)\nax3 = fig.add_subplot(223)\n\n# Simulate perturbation effects over time\ndays = np.linspace(0, 30, 100) # 30 days\nraan_evolution = iss_elements['raan'] + np.degrees(raan_dot) * days * 86400\nw_evolution = iss_elements['arg_periapsis'] + np.degrees(w_dot) * days * 86400\n\nax3.plot(days, raan_evolution, 'b-', label='RAAN', linewidth=2)\nax3.plot(days, w_evolution, 'r-', label='Arg. of Periapsis', linewidth=2)\nax3.set_xlabel('Time (days)')\nax3.set_ylabel('Angle (degrees)')\nax3.set_title('Orbital Element Evolution (J2 Perturbation)')\nax3.legend()\nax3.grid(True, alpha=0.3)\n\n# Transfer orbit comparison\nax4 = fig.add_subplot(224)\n\n# Plot circular orbits\ntheta = np.linspace(0, 2*np.pi, 100)\nr_iss_circle = r_iss * np.ones_like(theta)\nr_geo_circle = r_geo * np.ones_like(theta)\nr_transfer_peri = r_iss * np.ones_like(theta)\nr_transfer_apo = r_geo * np.ones_like(theta)\n\n# Convert to Cartesian for plotting\niss_x = r_iss_circle * np.cos(theta)\niss_y = r_iss_circle * np.sin(theta)\ngeo_x = r_geo_circle * np.cos(theta)\ngeo_y = r_geo_circle * np.sin(theta)\n\n# Hohmann transfer ellipse\na_transfer = transfer['a_transfer']\ne_transfer = (r_geo - r_iss) / (r_geo + r_iss)\ntheta_transfer = np.linspace(0, np.pi, 50) # Half ellipse\nr_transfer = a_transfer * (1 - e_transfer**2) / (1 + e_transfer * np.cos(theta_transfer))\ntransfer_x = r_transfer * np.cos(theta_transfer)\ntransfer_y = r_transfer * np.sin(theta_transfer)\n\nax4.plot(iss_x, iss_y, 'b-', label='ISS Orbit', linewidth=2)\nax4.plot(geo_x, geo_y, 'g-', label='GEO Orbit', linewidth=2)\nax4.plot(transfer_x, transfer_y, 'r--', label='Hohmann Transfer', linewidth=2)\n\n# Plot Earth\nearth_circle = plt.Circle((0, 0), R_earth, color='blue', alpha=0.3)\nax4.add_patch(earth_circle)\n\nax4.set_xlabel('X (km)')\nax4.set_ylabel('Y (km)')\nax4.set_title('Hohmann Transfer to GEO')\nax4.legend()\nax4.grid(True, alpha=0.3)\nax4.set_aspect('equal')\nax4.set_xlim(-50000, 50000)\nax4.set_ylim(-50000, 50000)\n\nplt.tight_layout()\n\n# Save visualization\nwith tempfile.NamedTemporaryFile(suffix='.png', delete=False) as tmp:\n plt.savefig(tmp.name, dpi=150, bbox_inches='tight')\n viz_file = tmp.name\n\nplt.close()\nprint(f'Astrodynamics visualization saved to: {viz_file}')\n\n# Summary report\nprint('\\n' + '=' * 38)\nprint('POLIASTRO ASTRODYNAMICS SUMMARY')\nprint('=' * 38)\nprint(f'Analyzed orbit: {iss_elements[\"semi_major_axis\"]:.1f} km semi-major axis')\nprint(f'Orbital period: {period/3600:.2f} hours')\nprint(f'Inclination: {iss_elements[\"inclination\"]:.1f}°')\nprint(f'\\nPerturbation effects (per day):')\nprint(f' RAAN precession: {np.degrees(raan_dot)*86400:.3f}°')\nprint(f' Periapsis rotation: {np.degrees(w_dot)*86400:.3f}°')\nprint(f'\\nHohmann transfer to GEO:')\nprint(f' Total ΔV required: {transfer[\"total_delta_v\"]:.3f} km/s')\nprint(f' Transfer time: {transfer[\"transfer_time\"]/3600:.2f} hours')\nprint(f'\\nInterplanetary mission (Earth-Mars):')\nprint(f' Transfer time: {mars_transfer[\"transfer_time\"]/(24*3600):.0f} days')\nprint(f' Total ΔV: {mars_transfer[\"total_delta_v\"]:.2f} km/s')\n\n# Cleanup\nos.unlink(viz_file)\nprint('\\nDemo complete - temporary files cleaned up')\n\nprint('\\npoliastro provides:')\nprint('• Pure Python astrodynamics library')\nprint('• Orbit propagation and determination')\nprint('• Maneuver planning and optimization')\nprint('• Coordinate system transformations')\nprint('• Mission analysis tools')\nprint('• Integration with scientific Python ecosystem')\nprint('• Interactive plotting and visualization')\n\nprint('\\nTypical poliastro usage:')\nprint('from poliastro.bodies import Earth')\nprint('from poliastro.twobody import Orbit')\nprint('orbit = Orbit.from_classical(Earth, a, ecc, inc, raan, argp, nu)')\nprint('orbit.plot()')",
|
|
946
|
+
"quick_start": [
|
|
947
|
+
"Install: pip install poliastro",
|
|
948
|
+
"Import: from poliastro.bodies import Earth",
|
|
949
|
+
"Create: from poliastro.twobody import Orbit",
|
|
950
|
+
"Define: orbit = Orbit.from_classical(...)",
|
|
951
|
+
"Plot: orbit.plot()",
|
|
952
|
+
"Analyze orbital mechanics and mission planning"
|
|
953
|
+
]
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"type": "PackageTool",
|
|
958
|
+
"name": "get_scholarly_info",
|
|
959
|
+
"description": "Get comprehensive information about scholarly – Google Scholar data retrieval",
|
|
960
|
+
"parameter": {
|
|
961
|
+
"type": "object",
|
|
962
|
+
"properties": {
|
|
963
|
+
"info_type": {
|
|
964
|
+
"type": "string",
|
|
965
|
+
"enum": [
|
|
966
|
+
"overview",
|
|
967
|
+
"installation",
|
|
968
|
+
"usage",
|
|
969
|
+
"documentation"
|
|
970
|
+
],
|
|
971
|
+
"description": "Type of information to retrieve about scholarly"
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
"required": [
|
|
975
|
+
"info_type"
|
|
976
|
+
]
|
|
977
|
+
},
|
|
978
|
+
"package_name": "scholarly",
|
|
979
|
+
"local_info": {
|
|
980
|
+
"name": "scholarly",
|
|
981
|
+
"description": "Python library for retrieving scholarly publications from Google Scholar. Provides programmatic access to publication data, author profiles, and citation information for bibliometric analysis.",
|
|
982
|
+
"category": "Academic Research / Bibliometrics",
|
|
983
|
+
"import_name": "scholarly",
|
|
984
|
+
"popularity": 75,
|
|
985
|
+
"keywords": [
|
|
986
|
+
"Google Scholar",
|
|
987
|
+
"publications",
|
|
988
|
+
"citations",
|
|
989
|
+
"bibliometrics",
|
|
990
|
+
"academic research"
|
|
991
|
+
],
|
|
992
|
+
"documentation": "https://scholarly.readthedocs.io/",
|
|
993
|
+
"repository": "https://github.com/scholarly-python-package/scholarly",
|
|
994
|
+
"installation": {
|
|
995
|
+
"pip": "pip install scholarly",
|
|
996
|
+
"conda": "conda install -c conda-forge scholarly"
|
|
997
|
+
},
|
|
998
|
+
"usage_example": "from scholarly import scholarly\nimport time\n\n# Search for publications\nprint('Searching for publications on \"machine learning\"...')\n\ntry:\n # Search for papers\n search_query = scholarly.search_pubs('machine learning')\n \n # Get first 3 results\n papers = []\n for i in range(3):\n try:\n paper = next(search_query)\n papers.append(paper)\n time.sleep(1) # Be respectful\n except StopIteration:\n break\n \n print(f'Found {len(papers)} papers:')\n for i, paper in enumerate(papers, 1):\n print(f'\\n{i}. {paper.get(\"title\", \"Unknown title\")}')\n print(f' Authors: {paper.get(\"author\", \"Unknown authors\")}')\n print(f' Year: {paper.get(\"year\", \"Unknown year\")}')\n print(f' Citations: {paper.get(\"num_citations\", 0)}')\n if 'pub_url' in paper:\n print(f' URL: {paper[\"pub_url\"]}')\n \nexcept Exception as e:\n print(f'Publication search failed: {e}')\n\n# Search for author\nprint('\\n' + '='*50)\nprint('Searching for author profile...')\n\ntry:\n # Search for an author (example)\n search_query = scholarly.search_author('Andrew Ng')\n author = next(search_query)\n \n # Fill in author details\n author_filled = scholarly.fill(author)\n \n print(f'Author: {author_filled.get(\"name\", \"Unknown\")}')\n print(f'Affiliation: {author_filled.get(\"affiliation\", \"Unknown\")}')\n print(f'Total citations: {author_filled.get(\"citedby\", 0)}')\n print(f'h-index: {author_filled.get(\"hindex\", 0)}')\n print(f'i10-index: {author_filled.get(\"i10index\", 0)}')\n \n # List recent publications\n publications = author_filled.get('publications', [])\n print(f'\\nRecent publications ({min(3, len(publications))}):')\n for i, pub in enumerate(publications[:3], 1):\n print(f'{i}. {pub.get(\"title\", \"Unknown title\")}')\n print(f' Citations: {pub.get(\"num_citations\", 0)}')\n \nexcept Exception as e:\n print(f'Author search failed: {e}')\n\nprint('\\nNote: Be mindful of rate limits when using Google Scholar')",
|
|
999
|
+
"quick_start": [
|
|
1000
|
+
"Install: pip install scholarly",
|
|
1001
|
+
"Search papers: scholarly.search_pubs('query')",
|
|
1002
|
+
"Search authors: scholarly.search_author('name')",
|
|
1003
|
+
"Get details: scholarly.fill(result)",
|
|
1004
|
+
"Access citations: result['num_citations']",
|
|
1005
|
+
"Use delays to avoid rate limits"
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"type": "PackageTool",
|
|
1011
|
+
"name": "get_flowio_info",
|
|
1012
|
+
"description": "Get comprehensive information about FlowIO – FCS file I/O for flow cytometry",
|
|
1013
|
+
"parameter": {
|
|
1014
|
+
"type": "object",
|
|
1015
|
+
"properties": {
|
|
1016
|
+
"info_type": {
|
|
1017
|
+
"type": "string",
|
|
1018
|
+
"enum": [
|
|
1019
|
+
"overview",
|
|
1020
|
+
"installation",
|
|
1021
|
+
"usage",
|
|
1022
|
+
"documentation"
|
|
1023
|
+
],
|
|
1024
|
+
"description": "Type of information to retrieve about FlowIO"
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
"required": [
|
|
1028
|
+
"info_type"
|
|
1029
|
+
]
|
|
1030
|
+
},
|
|
1031
|
+
"package_name": "FlowIO",
|
|
1032
|
+
"local_info": {
|
|
1033
|
+
"name": "FlowIO",
|
|
1034
|
+
"description": "Python library for reading and writing Flow Cytometry Standard (FCS) files. Provides efficient parsing of FCS 2.0, 3.0, and 3.1 formats with full metadata access and event data extraction.",
|
|
1035
|
+
"category": "Flow Cytometry I/O",
|
|
1036
|
+
"import_name": "flowio",
|
|
1037
|
+
"popularity": 60,
|
|
1038
|
+
"keywords": [
|
|
1039
|
+
"FCS files",
|
|
1040
|
+
"flow cytometry",
|
|
1041
|
+
"file format",
|
|
1042
|
+
"data import",
|
|
1043
|
+
"metadata"
|
|
1044
|
+
],
|
|
1045
|
+
"documentation": "https://github.com/whitews/FlowIO",
|
|
1046
|
+
"repository": "https://github.com/whitews/FlowIO",
|
|
1047
|
+
"installation": {
|
|
1048
|
+
"pip": "pip install FlowIO",
|
|
1049
|
+
"conda": "conda install -c conda-forge flowio"
|
|
1050
|
+
},
|
|
1051
|
+
"usage_example": "import flowio\nimport numpy as np\nimport pandas as pd\n\n# Read FCS file\nfcs_file = flowio.FlowData('sample.fcs')\n\n# Get basic information\nprint(f'FCS version: {fcs_file.header[\"FCS\"]}')\nprint(f'Event count: {fcs_file.event_count}')\nprint(f'Parameter count: {fcs_file.channel_count}')\n\n# Access metadata\nprint('\\nChannel information:')\nfor i, channel in enumerate(fcs_file.channels):\n print(f'Channel {i+1}: {channel[\"PnN\"]} ({channel[\"PnS\"]})')\n\n# Get event data as numpy array\nevents = np.reshape(fcs_file.events, (-1, fcs_file.channel_count))\nprint(f'Events shape: {events.shape}')\n\n# Convert to pandas DataFrame\nchannel_names = [ch['PnN'] for ch in fcs_file.channels]\ndf = pd.DataFrame(events, columns=channel_names)\nprint('\\nFirst 5 events:')\nprint(df.head())\n\n# Access specific parameters\nprint(f'\\nAcquisition date: {fcs_file.header.get(\"$DATE\", \"Not available\")}')\nprint(f'Instrument: {fcs_file.header.get(\"$CYT\", \"Not available\")}')\n\n# Check for compensation matrix\nif '$SPILLOVER' in fcs_file.header:\n print('Compensation matrix available')\nelse:\n print('No compensation matrix found')",
|
|
1052
|
+
"quick_start": [
|
|
1053
|
+
"Install: pip install FlowIO",
|
|
1054
|
+
"Read FCS: fcs = flowio.FlowData('file.fcs')",
|
|
1055
|
+
"Get events: events = fcs.events",
|
|
1056
|
+
"Get metadata: header = fcs.header",
|
|
1057
|
+
"Channel info: fcs.channels",
|
|
1058
|
+
"Convert to pandas: pd.DataFrame(events)"
|
|
1059
|
+
]
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
"type": "PackageTool",
|
|
1064
|
+
"name": "get_ruptures_info",
|
|
1065
|
+
"description": "Get comprehensive information about ruptures – change point detection library",
|
|
1066
|
+
"parameter": {
|
|
1067
|
+
"type": "object",
|
|
1068
|
+
"properties": {
|
|
1069
|
+
"info_type": {
|
|
1070
|
+
"type": "string",
|
|
1071
|
+
"enum": [
|
|
1072
|
+
"overview",
|
|
1073
|
+
"installation",
|
|
1074
|
+
"usage",
|
|
1075
|
+
"documentation"
|
|
1076
|
+
],
|
|
1077
|
+
"description": "Type of information to retrieve about ruptures"
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
1080
|
+
"required": [
|
|
1081
|
+
"info_type"
|
|
1082
|
+
]
|
|
1083
|
+
},
|
|
1084
|
+
"package_name": "ruptures",
|
|
1085
|
+
"local_info": {
|
|
1086
|
+
"name": "ruptures",
|
|
1087
|
+
"description": "Change point detection library. Provides algorithms for detecting abrupt changes in time series data, with applications in signal processing, genomics, finance, and scientific data analysis.",
|
|
1088
|
+
"category": "Scientific Computing / Signal Processing",
|
|
1089
|
+
"import_name": "ruptures",
|
|
1090
|
+
"popularity": 75,
|
|
1091
|
+
"keywords": [
|
|
1092
|
+
"change point detection",
|
|
1093
|
+
"time series",
|
|
1094
|
+
"signal processing",
|
|
1095
|
+
"segmentation",
|
|
1096
|
+
"anomaly detection"
|
|
1097
|
+
],
|
|
1098
|
+
"documentation": "https://centre-borelli.github.io/ruptures-docs/",
|
|
1099
|
+
"repository": "https://github.com/deepcharles/ruptures",
|
|
1100
|
+
"installation": {
|
|
1101
|
+
"pip": "pip install ruptures",
|
|
1102
|
+
"conda": "conda install -c conda-forge ruptures"
|
|
1103
|
+
},
|
|
1104
|
+
"usage_example": "# ruptures change point detection demonstration\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom scipy import signal\nfrom sklearn.preprocessing import StandardScaler\nimport tempfile\nimport os\n\n# Simulate ruptures functionality\ndef pelt_algorithm(data, penalty=10):\n \"\"\"Simplified PELT algorithm for change point detection\"\"\"\n n = len(data)\n F = np.full(n + 1, np.inf)\n F[0] = -penalty\n cp_candidates = [0]\n \n for t in range(1, n + 1):\n for s in cp_candidates:\n if s < t:\n segment_data = data[s:t]\n if len(segment_data) > 0:\n cost = np.var(segment_data) * len(segment_data)\n total_cost = F[s] + cost + penalty\n \n if total_cost < F[t]:\n F[t] = total_cost\n \n # Pruning step\n cp_candidates = [s for s in cp_candidates if F[s] <= F[t] - penalty]\n cp_candidates.append(t)\n \n # Backtrack to find change points\n change_points = []\n t = n\n while t > 0:\n for s in range(t):\n if s in cp_candidates:\n segment_data = data[s:t]\n if len(segment_data) > 0:\n cost = np.var(segment_data) * len(segment_data)\n if abs(F[t] - (F[s] + cost + penalty)) < 1e-10:\n if s > 0:\n change_points.append(s)\n t = s\n break\n else:\n break\n \n return sorted(change_points)\n\ndef binary_segmentation(data, max_changepoints=10):\n \"\"\"Simplified binary segmentation algorithm\"\"\"\n def find_best_split(segment_data, start_idx):\n n = len(segment_data)\n if n < 4: # Minimum segment size\n return None, -np.inf\n \n best_score = -np.inf\n best_split = None\n \n for split in range(2, n - 1):\n left = segment_data[:split]\n right = segment_data[split:]\n \n # Calculate score based on variance reduction\n total_var = np.var(segment_data) * n\n left_var = np.var(left) * len(left)\n right_var = np.var(right) * len(right)\n \n score = total_var - (left_var + right_var)\n \n if score > best_score:\n best_score = score\n best_split = start_idx + split\n \n return best_split, best_score\n \n change_points = []\n segments = [(data, 0)] # (segment_data, start_index)\n \n for _ in range(max_changepoints):\n if not segments:\n break\n \n best_segment = None\n best_split = None\n best_score = -np.inf\n \n # Find the best split among all segments\n for i, (segment_data, start_idx) in enumerate(segments):\n split, score = find_best_split(segment_data, start_idx)\n if split is not None and score > best_score:\n best_score = score\n best_split = split\n best_segment = i\n \n if best_split is None or best_score <= 0:\n break\n \n # Apply the best split\n segment_data, start_idx = segments.pop(best_segment)\n split_point = best_split - start_idx\n \n left_segment = segment_data[:split_point]\n right_segment = segment_data[split_point:]\n \n if len(left_segment) > 0:\n segments.append((left_segment, start_idx))\n if len(right_segment) > 0:\n segments.append((right_segment, best_split))\n \n change_points.append(best_split)\n \n return sorted(change_points)\n\nprint('ruptures - Change Point Detection Library')\nprint('=' * 45)\n\nprint('ruptures Features:')\nprint('• Multiple change point detection algorithms')\nprint('• PELT, Binary Segmentation, Window-based methods')\nprint('• Support for various cost functions')\nprint('• Multivariate time series analysis')\nprint('• Model selection and validation')\nprint('• Efficient implementations')\n\nprint('\\nApplications:')\nprint('• Signal processing and anomaly detection')\nprint('• Financial time series analysis')\nprint('• Genomic segmentation')\nprint('• Climate data analysis')\nprint('• Quality control in manufacturing')\n\n# Generate synthetic time series with change points\nprint('\\n=== Synthetic Time Series Generation ===')\n\nnp.random.seed(42)\n\n# Time series parameters\ntotal_length = 1000\ntrue_change_points = [200, 400, 650, 800]\nsegment_means = [1.0, 3.0, 0.5, 2.5, 1.8]\nsegment_stds = [0.5, 0.8, 0.3, 0.6, 0.4]\n\nprint(f'Generating time series with {len(true_change_points)} change points')\nprint(f'True change points: {true_change_points}')\nprint(f'Total length: {total_length} points')\n\n# Generate segments\ntime_series = []\ncurrent_pos = 0\n\nfor i, cp in enumerate(true_change_points + [total_length]):\n segment_length = cp - current_pos\n segment = np.random.normal(\n segment_means[i], \n segment_stds[i], \n segment_length\n )\n time_series.extend(segment)\n current_pos = cp\n\ntime_series = np.array(time_series)\ntime_points = np.arange(len(time_series))\n\nprint(f'Generated time series shape: {time_series.shape}')\nprint(f'Value range: {time_series.min():.2f} to {time_series.max():.2f}')\n\n# Add some noise and trends\nprint('\\nAdding noise and trends...')\n\n# Add noise\nnoise_level = 0.1\nnoise = np.random.normal(0, noise_level, len(time_series))\ntime_series_noisy = time_series + noise\n\n# Add slight trend\ntrend = 0.0005 * time_points\ntime_series_with_trend = time_series_noisy + trend\n\nprint(f'Noise level: {noise_level}')\nprint(f'Trend coefficient: 0.0005 per time unit')\n\n# Apply change point detection algorithms\nprint('\\n=== Change Point Detection ===')\n\n# Test different algorithms\nalgorithms = {\n 'PELT (penalty=5)': lambda x: pelt_algorithm(x, penalty=5),\n 'PELT (penalty=10)': lambda x: pelt_algorithm(x, penalty=10),\n 'PELT (penalty=20)': lambda x: pelt_algorithm(x, penalty=20),\n 'Binary Segmentation': lambda x: binary_segmentation(x, max_changepoints=8)\n}\n\nresults = {}\n\nfor algo_name, algo_func in algorithms.items():\n print(f'\\nRunning {algo_name}...')\n \n detected_cps = algo_func(time_series_with_trend)\n \n # Calculate performance metrics\n def calculate_metrics(true_cps, detected_cps, tolerance=50):\n \"\"\"Calculate precision, recall, and F1 score\"\"\"\n true_positives = 0\n \n for true_cp in true_cps:\n if any(abs(det_cp - true_cp) <= tolerance for det_cp in detected_cps):\n true_positives += 1\n \n precision = true_positives / len(detected_cps) if detected_cps else 0\n recall = true_positives / len(true_cps) if true_cps else 0\n f1 = 2 * precision * recall / (precision + recall) if (precision + recall) > 0 else 0\n \n return precision, recall, f1\n \n precision, recall, f1 = calculate_metrics(true_change_points, detected_cps)\n \n results[algo_name] = {\n 'detected_cps': detected_cps,\n 'precision': precision,\n 'recall': recall,\n 'f1': f1\n }\n \n print(f' Detected change points: {detected_cps}')\n print(f' Precision: {precision:.3f}')\n print(f' Recall: {recall:.3f}')\n print(f' F1 Score: {f1:.3f}')\n\n# Compare algorithms\nprint('\\n=== Algorithm Comparison ===')\n\nperformance_df = pd.DataFrame({\n 'Algorithm': list(results.keys()),\n 'Precision': [results[algo]['precision'] for algo in results],\n 'Recall': [results[algo]['recall'] for algo in results],\n 'F1 Score': [results[algo]['f1'] for algo in results],\n 'Num Detected': [len(results[algo]['detected_cps']) for algo in results]\n})\n\nprint(performance_df.round(3))\n\n# Best algorithm\nbest_algo = performance_df.loc[performance_df['F1 Score'].idxmax(), 'Algorithm']\nprint(f'\\nBest performing algorithm: {best_algo}')\nprint(f'F1 Score: {performance_df.loc[performance_df[\"F1 Score\"].idxmax(), \"F1 Score\"]:.3f}')\n\n# Multivariate change point detection simulation\nprint('\\n=== Multivariate Change Point Detection ===')\n\n# Generate multivariate time series\nn_dims = 3\nmv_length = 500\nmv_change_points = [150, 300, 400]\n\nprint(f'Generating {n_dims}D time series with change points at {mv_change_points}')\n\nmv_time_series = []\ncurrent_pos = 0\n\n# Different correlation structures for each segment\ncorr_matrices = [\n np.array([[1.0, 0.2, 0.1], [0.2, 1.0, 0.3], [0.1, 0.3, 1.0]]), # Low correlation\n np.array([[1.0, 0.8, 0.6], [0.8, 1.0, 0.7], [0.6, 0.7, 1.0]]), # High correlation\n np.array([[1.0, -0.5, 0.2], [-0.5, 1.0, -0.3], [0.2, -0.3, 1.0]]), # Mixed correlation\n np.array([[1.0, 0.1, 0.9], [0.1, 1.0, 0.2], [0.9, 0.2, 1.0]]) # Selective correlation\n]\n\nfor i, cp in enumerate(mv_change_points + [mv_length]):\n segment_length = cp - current_pos\n \n # Generate correlated multivariate normal data\n mean = np.random.normal(0, 2, n_dims)\n cov = corr_matrices[i]\n \n segment = np.random.multivariate_normal(mean, cov, segment_length)\n mv_time_series.append(segment)\n \n current_pos = cp\n\nmv_time_series = np.vstack(mv_time_series)\nprint(f'Multivariate time series shape: {mv_time_series.shape}')\n\n# Detect change points in each dimension\nprint('\\nDetecting change points in each dimension:')\nmv_results = {}\n\nfor dim in range(n_dims):\n dim_data = mv_time_series[:, dim]\n detected_cps = binary_segmentation(dim_data, max_changepoints=5)\n \n precision, recall, f1 = calculate_metrics(mv_change_points, detected_cps, tolerance=25)\n \n mv_results[f'Dimension {dim}'] = {\n 'detected_cps': detected_cps,\n 'precision': precision,\n 'recall': recall,\n 'f1': f1\n }\n \n print(f' Dim {dim}: CPs = {detected_cps}, F1 = {f1:.3f}')\n\n# Aggregate multivariate detection (simple approach)\nprint('\\nAggregate multivariate detection:')\n\n# Sum of squared differences approach\nsum_sq_diff = np.sum(np.diff(mv_time_series, axis=0)**2, axis=1)\ndetected_cps_mv = binary_segmentation(sum_sq_diff, max_changepoints=5)\n\nprecision_mv, recall_mv, f1_mv = calculate_metrics(mv_change_points, detected_cps_mv, tolerance=25)\nprint(f' Aggregate CPs: {detected_cps_mv}')\nprint(f' Precision: {precision_mv:.3f}, Recall: {recall_mv:.3f}, F1: {f1_mv:.3f}')\n\n# Model selection simulation\nprint('\\n=== Model Selection ===')\n\n# Test different penalty values for PELT\npenalty_values = [1, 2, 5, 10, 15, 20, 30, 50]\nmodel_selection_results = []\n\nfor penalty in penalty_values:\n detected_cps = pelt_algorithm(time_series_with_trend, penalty=penalty)\n \n # Calculate BIC-like criterion\n n_segments = len(detected_cps) + 1\n n_params = n_segments * 2 # mean and variance for each segment\n \n # Calculate likelihood (simplified)\n log_likelihood = 0\n current_pos = 0\n \n for cp in detected_cps + [len(time_series_with_trend)]:\n segment_data = time_series_with_trend[current_pos:cp]\n if len(segment_data) > 0:\n segment_var = np.var(segment_data)\n if segment_var > 0:\n log_likelihood -= 0.5 * len(segment_data) * np.log(2 * np.pi * segment_var)\n log_likelihood -= 0.5 * len(segment_data)\n current_pos = cp\n \n bic = -2 * log_likelihood + n_params * np.log(len(time_series_with_trend))\n \n precision, recall, f1 = calculate_metrics(true_change_points, detected_cps)\n \n model_selection_results.append({\n 'penalty': penalty,\n 'n_changepoints': len(detected_cps),\n 'bic': bic,\n 'precision': precision,\n 'recall': recall,\n 'f1': f1\n })\n\nmodel_df = pd.DataFrame(model_selection_results)\n\nprint('Model selection results:')\nprint(model_df.round(3))\n\n# Best model by BIC\nbest_bic_idx = model_df['bic'].idxmin()\nbest_penalty = model_df.loc[best_bic_idx, 'penalty']\nprint(f'\\nBest penalty by BIC: {best_penalty}')\nprint(f'Corresponding F1 score: {model_df.loc[best_bic_idx, \"f1\"]:.3f}')\n\n# Visualization\nprint('\\n=== Visualization ===')\n\nfig, axes = plt.subplots(2, 2, figsize=(15, 10))\n\n# 1. Original time series with change points\nax1 = axes[0, 0]\nax1.plot(time_points, time_series_with_trend, 'b-', alpha=0.7, linewidth=1)\n\n# True change points\nfor cp in true_change_points:\n ax1.axvline(x=cp, color='red', linestyle='--', alpha=0.8, label='True CP' if cp == true_change_points[0] else '')\n\n# Best detected change points\nbest_detected = results[best_algo]['detected_cps']\nfor cp in best_detected:\n ax1.axvline(x=cp, color='green', linestyle=':', alpha=0.8, label='Detected CP' if cp == best_detected[0] else '')\n\nax1.set_xlabel('Time')\nax1.set_ylabel('Value')\nax1.set_title('Time Series with Change Points')\nax1.legend()\nax1.grid(True, alpha=0.3)\n\n# 2. Algorithm performance comparison\nax2 = axes[0, 1]\nmetrics = ['Precision', 'Recall', 'F1 Score']\nbar_width = 0.2\nx_pos = np.arange(len(metrics))\n\nfor i, algo in enumerate(results.keys()):\n values = [results[algo]['precision'], results[algo]['recall'], results[algo]['f1']]\n ax2.bar(x_pos + i*bar_width, values, bar_width, label=algo, alpha=0.8)\n\nax2.set_xlabel('Metrics')\nax2.set_ylabel('Score')\nax2.set_title('Algorithm Performance Comparison')\nax2.set_xticks(x_pos + bar_width * 1.5)\nax2.set_xticklabels(metrics)\nax2.legend(bbox_to_anchor=(1.05, 1), loc='upper left')\nax2.grid(True, alpha=0.3)\nax2.set_ylim(0, 1.1)\n\n# 3. Multivariate time series\nax3 = axes[1, 0]\nfor dim in range(min(n_dims, 3)):\n ax3.plot(mv_time_series[:, dim], label=f'Dimension {dim}', alpha=0.7)\n\nfor cp in mv_change_points:\n ax3.axvline(x=cp, color='red', linestyle='--', alpha=0.6)\n\nax3.set_xlabel('Time')\nax3.set_ylabel('Value')\nax3.set_title('Multivariate Time Series')\nax3.legend()\nax3.grid(True, alpha=0.3)\n\n# 4. Model selection (BIC vs penalty)\nax4 = axes[1, 1]\nax4.plot(model_df['penalty'], model_df['bic'], 'bo-', label='BIC')\nax4.axvline(x=best_penalty, color='red', linestyle='--', alpha=0.8, label=f'Best penalty ({best_penalty})')\n\n# Secondary y-axis for F1 score\nax4_twin = ax4.twinx()\nax4_twin.plot(model_df['penalty'], model_df['f1'], 'ro-', alpha=0.7, label='F1 Score')\n\nax4.set_xlabel('Penalty Value')\nax4.set_ylabel('BIC', color='blue')\nax4_twin.set_ylabel('F1 Score', color='red')\nax4.set_title('Model Selection: BIC vs Penalty')\nax4.legend(loc='upper left')\nax4_twin.legend(loc='upper right')\nax4.grid(True, alpha=0.3)\n\nplt.tight_layout()\n\n# Save visualization\nwith tempfile.NamedTemporaryFile(suffix='.png', delete=False) as tmp:\n plt.savefig(tmp.name, dpi=150, bbox_inches='tight')\n viz_file = tmp.name\n\nplt.close()\nprint(f'Change point detection visualization saved to: {viz_file}')\n\n# Summary report\nprint('\\n' + '=' * 45)\nprint('RUPTURES CHANGE POINT DETECTION SUMMARY')\nprint('=' * 45)\nprint(f'Time series length: {len(time_series_with_trend):,} points')\nprint(f'True change points: {len(true_change_points)}')\nprint(f'Best algorithm: {best_algo}')\nprint(f'Best F1 score: {max(results[algo][\"f1\"] for algo in results):.3f}')\nprint(f'\\nAlgorithm rankings by F1 score:')\nfor i, (algo, metrics) in enumerate(sorted(results.items(), key=lambda x: x[1]['f1'], reverse=True), 1):\n print(f' {i}. {algo}: {metrics[\"f1\"]:.3f}')\nprint(f'\\nMultivariate detection F1 score: {f1_mv:.3f}')\nprint(f'Optimal penalty (BIC): {best_penalty}')\n\n# Cleanup\nos.unlink(viz_file)\nprint('\\nDemo complete - temporary files cleaned up')\n\nprint('\\nruptures provides:')\nprint('• Multiple change point detection algorithms')\nprint('• PELT, Binary Segmentation, Window methods')\nprint('• Multivariate time series support')\nprint('• Model selection and validation')\nprint('• Custom cost functions')\nprint('• Efficient implementations')\nprint('• Extensive documentation and examples')\n\nprint('\\nTypical ruptures usage:')\nprint('import ruptures as rpt')\nprint('algo = rpt.Pelt(model=\"rbf\").fit(signal)')\nprint('result = algo.predict(pen=10)')",
|
|
1105
|
+
"quick_start": [
|
|
1106
|
+
"Install: pip install ruptures",
|
|
1107
|
+
"Import: import ruptures as rpt",
|
|
1108
|
+
"Fit: algo = rpt.Pelt(model='rbf').fit(signal)",
|
|
1109
|
+
"Predict: result = algo.predict(pen=10)",
|
|
1110
|
+
"Display: rpt.display(signal, result)",
|
|
1111
|
+
"Check change points in result list"
|
|
1112
|
+
]
|
|
1113
|
+
}
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"type": "PackageTool",
|
|
1117
|
+
"name": "get_loompy_info",
|
|
1118
|
+
"description": "Get comprehensive information about loompy – efficient storage for large omics datasets",
|
|
1119
|
+
"parameter": {
|
|
1120
|
+
"type": "object",
|
|
1121
|
+
"properties": {
|
|
1122
|
+
"info_type": {
|
|
1123
|
+
"type": "string",
|
|
1124
|
+
"enum": [
|
|
1125
|
+
"overview",
|
|
1126
|
+
"installation",
|
|
1127
|
+
"usage",
|
|
1128
|
+
"documentation"
|
|
1129
|
+
],
|
|
1130
|
+
"description": "Type of information to retrieve about loompy"
|
|
1131
|
+
}
|
|
1132
|
+
},
|
|
1133
|
+
"required": [
|
|
1134
|
+
"info_type"
|
|
1135
|
+
]
|
|
1136
|
+
},
|
|
1137
|
+
"package_name": "loompy",
|
|
1138
|
+
"local_info": {
|
|
1139
|
+
"name": "loompy",
|
|
1140
|
+
"description": "Python API for the Loom file format, designed for efficient storage and access of large omics datasets. Provides sparse matrix storage with rich metadata for single-cell and spatial genomics data.",
|
|
1141
|
+
"category": "Genomics Data Storage",
|
|
1142
|
+
"import_name": "loompy",
|
|
1143
|
+
"popularity": 70,
|
|
1144
|
+
"keywords": [
|
|
1145
|
+
"loom format",
|
|
1146
|
+
"sparse matrices",
|
|
1147
|
+
"single-cell",
|
|
1148
|
+
"genomics storage",
|
|
1149
|
+
"HDF5"
|
|
1150
|
+
],
|
|
1151
|
+
"documentation": "https://loompy.org/",
|
|
1152
|
+
"repository": "https://github.com/linnarsson-lab/loompy",
|
|
1153
|
+
"installation": {
|
|
1154
|
+
"pip": "pip install loompy",
|
|
1155
|
+
"conda": "conda install -c conda-forge loompy"
|
|
1156
|
+
},
|
|
1157
|
+
"usage_example": "import loompy\nimport numpy as np\nimport pandas as pd\n\n# Create sample data\nn_cells = 1000\nn_genes = 2000\nexpression_matrix = np.random.negative_binomial(10, 0.3, (n_genes, n_cells))\n\n# Create metadata\ngene_names = [f'Gene_{i}' for i in range(n_genes)]\ncell_types = np.random.choice(['TypeA', 'TypeB', 'TypeC'], n_cells)\ncell_ids = [f'Cell_{i}' for i in range(n_cells)]\n\n# Row attributes (genes)\nrow_attrs = {\n 'Gene': np.array(gene_names, dtype='S'),\n 'Chromosome': np.random.choice(['chr1', 'chr2', 'chr3'], n_genes)\n}\n\n# Column attributes (cells)\ncol_attrs = {\n 'CellID': np.array(cell_ids, dtype='S'),\n 'CellType': np.array(cell_types, dtype='S'),\n 'nUMI': np.random.poisson(5000, n_cells)\n}\n\n# Create Loom file\nwith loompy.new('dataset.loom') as ds:\n ds.add_columns(expression_matrix, col_attrs)\n for key, value in row_attrs.items():\n ds.ra[key] = value\n \n print(f'Created Loom file with {ds.shape[0]} genes and {ds.shape[1]} cells')\n\n# Read from Loom file\nwith loompy.connect('dataset.loom') as ds:\n print(f'Dataset shape: {ds.shape}')\n print(f'Gene attributes: {list(ds.ra.keys())}')\n print(f'Cell attributes: {list(ds.ca.keys())}')\n \n # Query specific genes\n mask = ds.ra.Gene == b'Gene_0'\n gene_expression = ds[mask, :]\n print(f'Expression for Gene_0: {gene_expression[0, :5]}')\n \n # Query specific cell types\n type_a_cells = ds.ca.CellType == b'TypeA'\n type_a_data = ds[:, type_a_cells]\n print(f'TypeA cells: {type_a_data.shape[1]}')",
|
|
1158
|
+
"quick_start": [
|
|
1159
|
+
"Install: pip install loompy",
|
|
1160
|
+
"Create file: loompy.new('file.loom')",
|
|
1161
|
+
"Add data: ds.add_columns(matrix, col_attrs)",
|
|
1162
|
+
"Set attributes: ds.ra['gene_name'] = names",
|
|
1163
|
+
"Read file: loompy.connect('file.loom')",
|
|
1164
|
+
"Query data: ds[gene_mask, cell_mask]"
|
|
1165
|
+
]
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
"type": "PackageTool",
|
|
1170
|
+
"name": "get_requests_info",
|
|
1171
|
+
"description": "Get comprehensive information about Requests - Python HTTP library for humans",
|
|
1172
|
+
"parameter": {
|
|
1173
|
+
"type": "object",
|
|
1174
|
+
"properties": {
|
|
1175
|
+
"include_examples": {
|
|
1176
|
+
"type": "boolean",
|
|
1177
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
1178
|
+
"default": true
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
},
|
|
1182
|
+
"package_name": "requests",
|
|
1183
|
+
"local_info": {
|
|
1184
|
+
"name": "Requests",
|
|
1185
|
+
"description": "Python HTTP library for humans. Allows you to send HTTP/1.1 requests extremely easily. There's no need to manually add query strings to your URLs, or to form-encode your POST data.",
|
|
1186
|
+
"category": "HTTP/Web",
|
|
1187
|
+
"import_name": "requests",
|
|
1188
|
+
"popularity": 88,
|
|
1189
|
+
"keywords": [
|
|
1190
|
+
"http",
|
|
1191
|
+
"web",
|
|
1192
|
+
"api",
|
|
1193
|
+
"rest",
|
|
1194
|
+
"client"
|
|
1195
|
+
],
|
|
1196
|
+
"documentation": "https://requests.readthedocs.io/",
|
|
1197
|
+
"repository": "https://github.com/psf/requests",
|
|
1198
|
+
"installation": {
|
|
1199
|
+
"pip": "pip install requests",
|
|
1200
|
+
"conda": "conda install requests"
|
|
1201
|
+
},
|
|
1202
|
+
"usage_example": "import requests\n\n# GET request\nresponse = requests.get('https://api.github.com/users/octocat')\nprint(response.json())\n\n# POST request\ndata = {'key': 'value'}\nresponse = requests.post('https://httpbin.org/post', json=data)\nprint(response.status_code)",
|
|
1203
|
+
"quick_start": [
|
|
1204
|
+
"1. Install requests: pip install requests",
|
|
1205
|
+
"2. Import the library: import requests",
|
|
1206
|
+
"3. Make a GET request: response = requests.get(url)",
|
|
1207
|
+
"4. Check response: response.status_code, response.json()",
|
|
1208
|
+
"5. Handle errors with response.raise_for_status()"
|
|
1209
|
+
]
|
|
1210
|
+
}
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
"type": "PackageTool",
|
|
1214
|
+
"name": "get_pyscreener_info",
|
|
1215
|
+
"description": "Get comprehensive information about PyScreener – high-throughput virtual screening in Python",
|
|
1216
|
+
"parameter": {
|
|
1217
|
+
"type": "object",
|
|
1218
|
+
"properties": {
|
|
1219
|
+
"info_type": {
|
|
1220
|
+
"type": "string",
|
|
1221
|
+
"enum": [
|
|
1222
|
+
"overview",
|
|
1223
|
+
"installation",
|
|
1224
|
+
"usage",
|
|
1225
|
+
"documentation"
|
|
1226
|
+
],
|
|
1227
|
+
"description": "Type of information to retrieve about PyScreener"
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
"required": [
|
|
1231
|
+
"info_type"
|
|
1232
|
+
]
|
|
1233
|
+
},
|
|
1234
|
+
"package_name": "pyscreener",
|
|
1235
|
+
"local_info": {
|
|
1236
|
+
"name": "PyScreener",
|
|
1237
|
+
"description": "High-throughput virtual screening toolkit for drug discovery. Provides Python interface to popular docking software and enables large-scale molecular docking workflows with parallel processing.",
|
|
1238
|
+
"category": "Drug Discovery / Virtual Screening",
|
|
1239
|
+
"import_name": "pyscreener",
|
|
1240
|
+
"popularity": 60,
|
|
1241
|
+
"keywords": [
|
|
1242
|
+
"virtual screening",
|
|
1243
|
+
"molecular docking",
|
|
1244
|
+
"drug discovery",
|
|
1245
|
+
"high-throughput",
|
|
1246
|
+
"AutoDock"
|
|
1247
|
+
],
|
|
1248
|
+
"documentation": "https://pyscreener.readthedocs.io/",
|
|
1249
|
+
"repository": "https://github.com/coleygroup/pyscreener",
|
|
1250
|
+
"installation": {
|
|
1251
|
+
"pip": "pip install pyscreener",
|
|
1252
|
+
"conda": "conda install -c conda-forge pyscreener"
|
|
1253
|
+
},
|
|
1254
|
+
"usage_example": "import pyscreener as ps\nfrom pyscreener.docking import VinaDocking\n\n# Set up docking configuration\nreceptor_file = 'protein.pdbqt'\nligand_files = ['ligand1.sdf', 'ligand2.sdf', 'ligand3.sdf']\n\n# Initialize docking software (AutoDock Vina)\ndocking_runner = VinaDocking(\n receptor_file=receptor_file,\n center=(10.0, 15.0, 20.0), # Binding site center\n size=(20.0, 20.0, 20.0), # Search box size\n num_modes=5,\n exhaustiveness=8\n)\n\n# Run virtual screening\nscores = docking_runner.dock(ligand_files, \n ncpu=4, # Parallel processing\n score_mode='best')\n\nprint('Docking scores:')\nfor ligand, score in scores.items():\n print(f'{ligand}: {score:.2f}')\n\n# Rank compounds by docking score\nsorted_scores = sorted(scores.items(), key=lambda x: x[1])\nprint(f'Best compound: {sorted_scores[0][0]} (score: {sorted_scores[0][1]:.2f})')",
|
|
1255
|
+
"quick_start": [
|
|
1256
|
+
"Install: pip install pyscreener",
|
|
1257
|
+
"Prepare receptor: convert protein to PDBQT format",
|
|
1258
|
+
"Initialize docking: VinaDocking(receptor_file, center, size)",
|
|
1259
|
+
"Run screening: docking_runner.dock(ligand_files)",
|
|
1260
|
+
"Analyze results: sort by docking scores",
|
|
1261
|
+
"Requires AutoDock Vina installation"
|
|
1262
|
+
]
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
"type": "PackageTool",
|
|
1267
|
+
"name": "get_pykalman_info",
|
|
1268
|
+
"description": "Get comprehensive information about PyKalman – Kalman filtering and smoothing",
|
|
1269
|
+
"parameter": {
|
|
1270
|
+
"type": "object",
|
|
1271
|
+
"properties": {
|
|
1272
|
+
"info_type": {
|
|
1273
|
+
"type": "string",
|
|
1274
|
+
"enum": [
|
|
1275
|
+
"overview",
|
|
1276
|
+
"installation",
|
|
1277
|
+
"usage",
|
|
1278
|
+
"documentation"
|
|
1279
|
+
],
|
|
1280
|
+
"description": "Type of information to retrieve about PyKalman"
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
"required": [
|
|
1284
|
+
"info_type"
|
|
1285
|
+
]
|
|
1286
|
+
},
|
|
1287
|
+
"package_name": "pykalman",
|
|
1288
|
+
"local_info": {
|
|
1289
|
+
"name": "PyKalman",
|
|
1290
|
+
"description": "Implementation of Kalman Filter, Extended Kalman Filter, and Unscented Kalman Filter for state estimation in time series and dynamic systems. Useful for tracking, smoothing, and parameter estimation.",
|
|
1291
|
+
"category": "Time Series / State Estimation",
|
|
1292
|
+
"import_name": "pykalman",
|
|
1293
|
+
"popularity": 65,
|
|
1294
|
+
"keywords": [
|
|
1295
|
+
"Kalman filter",
|
|
1296
|
+
"state estimation",
|
|
1297
|
+
"time series",
|
|
1298
|
+
"tracking",
|
|
1299
|
+
"smoothing",
|
|
1300
|
+
"dynamic systems"
|
|
1301
|
+
],
|
|
1302
|
+
"documentation": "https://pykalman.github.io/",
|
|
1303
|
+
"repository": "https://github.com/pykalman/pykalman",
|
|
1304
|
+
"installation": {
|
|
1305
|
+
"pip": "pip install pykalman",
|
|
1306
|
+
"conda": "conda install -c conda-forge pykalman"
|
|
1307
|
+
},
|
|
1308
|
+
"usage_example": "import numpy as np\nimport matplotlib.pyplot as plt\nfrom pykalman import KalmanFilter\n\n# Generate noisy observations of a sine wave\nnp.random.seed(42)\nn_timesteps = 100\ntrue_states = np.sin(np.linspace(0, 4*np.pi, n_timesteps))\nobservations = true_states + 0.3 * np.random.normal(size=n_timesteps)\n\n# Set up Kalman filter for 1D system\n# State: [position, velocity]\ntransition_matrices = np.array([[1, 1], [0, 1]]) # Position = position + velocity\nobservation_matrices = np.array([[1, 0]]) # Observe position only\n\nkf = KalmanFilter(\n transition_matrices=transition_matrices,\n observation_matrices=observation_matrices,\n initial_state_mean=[0, 0],\n n_dim_state=2\n)\n\n# Fit parameters and smooth\nstate_means, state_covariances = kf.em(\n observations.reshape(-1, 1),\n n_iter=10\n).smooth()[0:2]\n\n# Extract smoothed positions\nsmoothed_positions = state_means[:, 0]\n\n# Plot results\nplt.figure(figsize=(12, 6))\nplt.plot(true_states, 'g-', label='True signal', linewidth=2)\nplt.plot(observations, 'r.', alpha=0.5, label='Noisy observations')\nplt.plot(smoothed_positions, 'b-', label='Kalman smoothed', linewidth=2)\nplt.legend()\nplt.title('Kalman Filter Smoothing')\nplt.xlabel('Time')\nplt.ylabel('Value')\nplt.show()\n\nprint(f'Original noise level: {np.std(observations - true_states):.3f}')\nprint(f'After smoothing: {np.std(smoothed_positions - true_states):.3f}')",
|
|
1309
|
+
"quick_start": [
|
|
1310
|
+
"Install: pip install pykalman",
|
|
1311
|
+
"Import: from pykalman import KalmanFilter",
|
|
1312
|
+
"Define matrices: transition, observation matrices",
|
|
1313
|
+
"Create filter: KalmanFilter(transition_matrices, ...)",
|
|
1314
|
+
"Fit and smooth: kf.em().smooth()",
|
|
1315
|
+
"Extract results: state_means, state_covariances"
|
|
1316
|
+
]
|
|
1317
|
+
}
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
"type": "PackageTool",
|
|
1321
|
+
"name": "get_khmer_info",
|
|
1322
|
+
"description": "Get comprehensive information about khmer – nucleotide sequence k-mer analysis",
|
|
1323
|
+
"parameter": {
|
|
1324
|
+
"type": "object",
|
|
1325
|
+
"properties": {
|
|
1326
|
+
"info_type": {
|
|
1327
|
+
"type": "string",
|
|
1328
|
+
"enum": [
|
|
1329
|
+
"overview",
|
|
1330
|
+
"installation",
|
|
1331
|
+
"usage",
|
|
1332
|
+
"documentation"
|
|
1333
|
+
],
|
|
1334
|
+
"description": "Type of information to retrieve about khmer"
|
|
1335
|
+
}
|
|
1336
|
+
},
|
|
1337
|
+
"required": [
|
|
1338
|
+
"info_type"
|
|
1339
|
+
]
|
|
1340
|
+
},
|
|
1341
|
+
"package_name": "khmer",
|
|
1342
|
+
"local_info": {
|
|
1343
|
+
"name": "khmer",
|
|
1344
|
+
"description": "In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more. Provides efficient data structures for genomic sequence analysis and assembly preprocessing.",
|
|
1345
|
+
"category": "Genomics / Sequence Analysis",
|
|
1346
|
+
"import_name": "khmer",
|
|
1347
|
+
"popularity": 70,
|
|
1348
|
+
"keywords": [
|
|
1349
|
+
"k-mer",
|
|
1350
|
+
"sequence analysis",
|
|
1351
|
+
"bloom filter",
|
|
1352
|
+
"DNA",
|
|
1353
|
+
"graph traversal",
|
|
1354
|
+
"assembly"
|
|
1355
|
+
],
|
|
1356
|
+
"documentation": "https://khmer.readthedocs.io/",
|
|
1357
|
+
"repository": "https://github.com/dib-lab/khmer",
|
|
1358
|
+
"installation": {
|
|
1359
|
+
"pip": "pip install khmer",
|
|
1360
|
+
"conda": "conda install -c conda-forge khmer"
|
|
1361
|
+
},
|
|
1362
|
+
"usage_example": "import khmer\nimport tempfile\nimport os\n\n# Create temporary files for demo\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.fa', delete=False) as f:\n # Write sample sequences\n sequences = [\n '>seq1\\nACGTACGTACGTACGTACGTACGT',\n '>seq2\\nTGCATGCATGCATGCATGCATGCA',\n '>seq3\\nACGTTGCATGCATGCAAGCTACGT',\n '>seq4\\nGGGGAAAATTTTCCCCGGGGAAAA',\n '>seq5\\nACGTACGTTGCATGCATGCAACGT'\n ]\n for seq in sequences:\n f.write(seq + '\\n')\n fasta_file = f.name\n\nprint(f'Created sample FASTA file: {fasta_file}')\nprint('Sample sequences for k-mer analysis\\n')\n\n# K-mer counting with Countgraph\nprint('=== K-mer Counting ===')\nksize = 15 # k-mer size\ntablesize = 1e5 # hash table size\nn_tables = 4 # number of hash tables\n\n# Create counting hash\nprint(f'Creating Countgraph: k={ksize}, tablesize={int(tablesize)}, tables={n_tables}')\ncountgraph = khmer.Countgraph(ksize, tablesize, n_tables)\n\n# Count k-mers from sequences\nprint('Counting k-mers from sequences...')\ncountgraph.consume_seqfile(fasta_file)\n\nprint(f'Total k-mers counted: {countgraph.n_occupied()}')\nprint(f'Unique k-mers: {countgraph.n_unique_kmers()}')\n\n# Test specific k-mers\ntest_kmers = ['ACGTACGTACGTACG', 'TGCATGCATGCATGC', 'GGGGAAAAATTTTCC']\nprint('\\nK-mer abundance check:')\nfor kmer in test_kmers:\n if len(kmer) == ksize:\n count = countgraph.get(kmer)\n print(f' {kmer}: {count} occurrences')\n\n# K-mer filtering with Bloom Filter\nprint('\\n=== K-mer Filtering with Bloom Filter ===')\nbloom = khmer.Nodegraph(ksize, tablesize, n_tables)\n\n# Add k-mers to bloom filter\nbloom.consume_seqfile(fasta_file)\nprint(f'Bloom filter populated with k-mers')\nprint(f'False positive rate: {bloom.false_positive_rate():.6f}')\n\n# Test k-mer presence\nprint('\\nK-mer presence check:')\nfor kmer in test_kmers:\n if len(kmer) == ksize:\n present = bloom.get(kmer)\n print(f' {kmer}: {\"present\" if present else \"absent\"}')\n\n# Sequence filtering\nprint('\\n=== Sequence Filtering ===')\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.fa', delete=False) as f:\n # Add some low-complexity sequences\n filtered_seqs = sequences + [\n '>low_complex1\\nAAAAAAAAAAAAAAAAAAAAA',\n '>low_complex2\\nATATATATATATATATATATAT',\n '>good_seq\\nACGTGCATTGCAAACGTGCATT'\n ]\n for seq in filtered_seqs:\n f.write(seq + '\\n')\n filtered_file = f.name\n\nprint(f'Testing sequence filtering on {len(filtered_seqs)} sequences')\n\n# Create abundance filter\nabundance_filter = khmer.Countgraph(ksize, tablesize, n_tables)\nabundance_filter.consume_seqfile(filtered_file)\n\n# Filter sequences by k-mer abundance\nfiltered_count = 0\nwith open(filtered_file, 'r') as f:\n lines = f.readlines()\n \nfor i in range(0, len(lines), 2):\n if i+1 < len(lines):\n header = lines[i].strip()\n sequence = lines[i+1].strip()\n \n # Calculate median k-mer abundance\n if len(sequence) >= ksize:\n abundances = []\n for j in range(len(sequence) - ksize + 1):\n kmer = sequence[j:j+ksize]\n abundances.append(abundance_filter.get(kmer))\n \n if abundances:\n median_abundance = sorted(abundances)[len(abundances)//2]\n high_abundance = median_abundance > 1\n \n seq_name = header.replace('>', '')\n print(f' {seq_name:12s}: median abundance {median_abundance}, '\n f'{\"keep\" if high_abundance else \"filter\"}')\n \n if high_abundance:\n filtered_count += 1\n\nprint(f'\\nFiltered sequences: {filtered_count}/{len(filtered_seqs)}')\n\n# Graph traversal example\nprint('\\n=== Graph Traversal ===')\ngraph = khmer.Nodegraph(ksize, tablesize, n_tables)\ngraph.consume_seqfile(fasta_file)\n\n# Try to traverse from a starting k-mer\nstarting_kmer = 'ACGTACGTACGTACG'\nif len(starting_kmer) == ksize and graph.get(starting_kmer):\n print(f'Starting graph traversal from: {starting_kmer}')\n \n # Get neighbors (this is a simplified example)\n neighbors = []\n bases = ['A', 'T', 'G', 'C']\n \n # Check right extensions\n for base in bases:\n extended_kmer = starting_kmer[1:] + base\n if graph.get(extended_kmer):\n neighbors.append(extended_kmer)\n \n print(f'Right neighbors found: {len(neighbors)}')\n for neighbor in neighbors[:3]: # Show first 3\n print(f' -> {neighbor}')\n\n# Cleanup\nos.unlink(fasta_file)\nos.unlink(filtered_file)\nprint('\\nDemo complete - temporary files cleaned up')\n\nprint('\\nkhmer provides:')\nprint('- Efficient k-mer counting and filtering')\nprint('- Bloom filters for sequence data')\nprint('- Graph traversal algorithms')\nprint('- Memory-efficient data structures')\nprint('- Preprocessing for genome assembly')",
|
|
1363
|
+
"quick_start": [
|
|
1364
|
+
"Install: pip install khmer",
|
|
1365
|
+
"Count k-mers: cg = khmer.Countgraph(k, size, tables)",
|
|
1366
|
+
"Load sequences: cg.consume_seqfile(file)",
|
|
1367
|
+
"Check abundance: cg.get(kmer)",
|
|
1368
|
+
"Bloom filter: ng = khmer.Nodegraph(k, size, tables)",
|
|
1369
|
+
"Filter sequences by k-mer abundance"
|
|
1370
|
+
]
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
"type": "PackageTool",
|
|
1375
|
+
"name": "get_pymed_info",
|
|
1376
|
+
"description": "Get comprehensive information about PyMed – PubMed access in Python",
|
|
1377
|
+
"parameter": {
|
|
1378
|
+
"type": "object",
|
|
1379
|
+
"properties": {
|
|
1380
|
+
"include_examples": {
|
|
1381
|
+
"type": "boolean",
|
|
1382
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
1383
|
+
"default": true
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
},
|
|
1387
|
+
"package_name": "pymed",
|
|
1388
|
+
"local_info": {
|
|
1389
|
+
"name": "PyMed",
|
|
1390
|
+
"description": "Python library providing access to PubMed database for searching and retrieving biomedical literature. Simplifies querying and parsing of PubMed records.",
|
|
1391
|
+
"category": "Literature Mining",
|
|
1392
|
+
"import_name": "pymed",
|
|
1393
|
+
"popularity": 70,
|
|
1394
|
+
"keywords": [
|
|
1395
|
+
"PubMed",
|
|
1396
|
+
"literature search",
|
|
1397
|
+
"biomedical research",
|
|
1398
|
+
"scientific papers",
|
|
1399
|
+
"NCBI"
|
|
1400
|
+
],
|
|
1401
|
+
"documentation": "https://github.com/gijswobben/pymed",
|
|
1402
|
+
"repository": "https://github.com/gijswobben/pymed",
|
|
1403
|
+
"installation": {
|
|
1404
|
+
"pip": "pip install pymed",
|
|
1405
|
+
"conda": "conda install -c conda-forge pymed"
|
|
1406
|
+
},
|
|
1407
|
+
"usage_example": "from pymed import PubMed\n\n# Create PubMed object\npubmed = PubMed(tool='MyTool', email='my_email@example.com')\n\n# Search for articles\nquery = 'COVID-19 AND vaccine'\nresults = pubmed.query(query, max_results=10)\n\n# Process results\nfor article in results:\n print(f'Title: {article.title}')\n print(f'Authors: {article.authors}')\n print(f'Journal: {article.journal}')\n print(f'Publication date: {article.publication_date}')\n print(f'Abstract: {article.abstract[:200]}...')\n print('---')",
|
|
1408
|
+
"quick_start": [
|
|
1409
|
+
"1. Install PyMed: pip install pymed",
|
|
1410
|
+
"2. Import: from pymed import PubMed",
|
|
1411
|
+
"3. Initialize: pubmed = PubMed(tool='MyTool', email='email')",
|
|
1412
|
+
"4. Search: results = pubmed.query('COVID-19', max_results=10)",
|
|
1413
|
+
"5. Process: iterate through results"
|
|
1414
|
+
]
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"type": "PackageTool",
|
|
1419
|
+
"name": "get_networkx_info",
|
|
1420
|
+
"description": "Get comprehensive information about NetworkX – network analysis library",
|
|
1421
|
+
"parameter": {
|
|
1422
|
+
"type": "object",
|
|
1423
|
+
"properties": {
|
|
1424
|
+
"info_type": {
|
|
1425
|
+
"type": "string",
|
|
1426
|
+
"enum": [
|
|
1427
|
+
"overview",
|
|
1428
|
+
"installation",
|
|
1429
|
+
"usage",
|
|
1430
|
+
"documentation"
|
|
1431
|
+
],
|
|
1432
|
+
"description": "Type of information to retrieve about NetworkX"
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
"required": [
|
|
1436
|
+
"info_type"
|
|
1437
|
+
]
|
|
1438
|
+
},
|
|
1439
|
+
"package_name": "networkx",
|
|
1440
|
+
"local_info": {
|
|
1441
|
+
"name": "NetworkX",
|
|
1442
|
+
"description": "Python package for creation, manipulation, and study of complex networks. Provides data structures for graphs, digraphs, and multigraphs with many standard graph algorithms.",
|
|
1443
|
+
"category": "Network Analysis / Graph Theory",
|
|
1444
|
+
"import_name": "networkx",
|
|
1445
|
+
"popularity": 85,
|
|
1446
|
+
"keywords": [
|
|
1447
|
+
"graph theory",
|
|
1448
|
+
"network analysis",
|
|
1449
|
+
"social networks",
|
|
1450
|
+
"algorithms",
|
|
1451
|
+
"complex networks"
|
|
1452
|
+
],
|
|
1453
|
+
"documentation": "https://networkx.org/documentation/stable/",
|
|
1454
|
+
"repository": "https://github.com/networkx/networkx",
|
|
1455
|
+
"installation": {
|
|
1456
|
+
"pip": "pip install networkx",
|
|
1457
|
+
"conda": "conda install networkx"
|
|
1458
|
+
},
|
|
1459
|
+
"usage_example": "import networkx as nx\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom collections import Counter\nimport random\nimport tempfile\nimport os\n\nprint('NetworkX - Network Analysis in Python')\nprint('=' * 40)\n\n# Basic graph creation\nprint('\\n=== Basic Graph Creation ===')\n\n# Create different types of graphs\nG = nx.Graph() # Undirected graph\nDG = nx.DiGraph() # Directed graph\nMG = nx.MultiGraph() # Multi-edge graph\n\n# Add nodes and edges\nG.add_node(1)\nG.add_nodes_from([2, 3, 4, 5])\nG.add_edge(1, 2)\nG.add_edges_from([(1, 3), (2, 4), (3, 4), (4, 5)])\n\nprint(f'Graph G: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges')\nprint(f'Nodes: {list(G.nodes())}')\nprint(f'Edges: {list(G.edges())}')\nprint(f'Neighbors of node 1: {list(G.neighbors(1))}')\n\n# Graph from edge list\nedge_list = [(1, 2), (2, 3), (3, 4), (4, 1), (1, 3)]\nG_from_edges = nx.Graph(edge_list)\nprint(f'\\nGraph from edge list: {G_from_edges.number_of_nodes()} nodes, {G_from_edges.number_of_edges()} edges')\n\n# Famous graphs\nprint('\\n=== Famous Graphs ===')\nkarate = nx.karate_club_graph()\nprint(f'Karate Club: {karate.number_of_nodes()} nodes, {karate.number_of_edges()} edges')\n\npetersen = nx.petersen_graph()\nprint(f'Petersen Graph: {petersen.number_of_nodes()} nodes, {petersen.number_of_edges()} edges')\n\ncomplete = nx.complete_graph(6)\nprint(f'Complete K6: {complete.number_of_nodes()} nodes, {complete.number_of_edges()} edges')\n\n# Random graphs\nrandom_graph = nx.erdos_renyi_graph(50, 0.1)\nprint(f'Random ER(50, 0.1): {random_graph.number_of_nodes()} nodes, {random_graph.number_of_edges()} edges')\n\nscale_free = nx.barabasi_albert_graph(50, 3)\nprint(f'Scale-free BA(50, 3): {scale_free.number_of_nodes()} nodes, {scale_free.number_of_edges()} edges')\n\n# Basic graph properties\nprint('\\n=== Graph Properties ===')\nG_analysis = karate\n\n# Degree statistics\ndegrees = dict(G_analysis.degree())\nprint(f'Degree sequence: {sorted(degrees.values(), reverse=True)[:10]}...')\nprint(f'Average degree: {np.mean(list(degrees.values())):.2f}')\nprint(f'Max degree: {max(degrees.values())}')\nprint(f'Min degree: {min(degrees.values())}')\n\n# Connectivity\nprint(f'\\nIs connected: {nx.is_connected(G_analysis)}')\nprint(f'Number of connected components: {nx.number_connected_components(G_analysis)}')\nif nx.is_connected(G_analysis):\n print(f'Diameter: {nx.diameter(G_analysis)}')\n print(f'Radius: {nx.radius(G_analysis)}')\n print(f'Average shortest path length: {nx.average_shortest_path_length(G_analysis):.3f}')\n\n# Clustering\nprint(f'\\nAverage clustering coefficient: {nx.average_clustering(G_analysis):.3f}')\nprint(f'Global clustering coefficient: {nx.transitivity(G_analysis):.3f}')\n\n# Centrality measures\nprint('\\n=== Centrality Measures ===')\n\n# Different centrality measures\nbetweenness = nx.betweenness_centrality(G_analysis)\ncloseness = nx.closeness_centrality(G_analysis)\neigenvector = nx.eigenvector_centrality(G_analysis)\npagerank = nx.pagerank(G_analysis)\n\n# Top nodes by different centralities\nprint('Top 5 nodes by betweenness centrality:')\nfor node, centrality in sorted(betweenness.items(), key=lambda x: x[1], reverse=True)[:5]:\n print(f' Node {node}: {centrality:.3f}')\n\nprint('\\nTop 5 nodes by closeness centrality:')\nfor node, centrality in sorted(closeness.items(), key=lambda x: x[1], reverse=True)[:5]:\n print(f' Node {node}: {centrality:.3f}')\n\nprint('\\nTop 5 nodes by PageRank:')\nfor node, centrality in sorted(pagerank.items(), key=lambda x: x[1], reverse=True)[:5]:\n print(f' Node {node}: {centrality:.3f}')\n\n# Community detection\nprint('\\n=== Community Detection ===')\ntry:\n # Greedy modularity communities\n communities = nx.community.greedy_modularity_communities(G_analysis)\n print(f'Number of communities (greedy modularity): {len(communities)}')\n for i, community in enumerate(communities):\n print(f' Community {i}: {len(community)} nodes')\n \n # Modularity\n modularity = nx.community.modularity(G_analysis, communities)\n print(f'Modularity: {modularity:.3f}')\nexcept:\n print('Community detection requires additional packages')\n\n# Shortest paths\nprint('\\n=== Shortest Paths ===')\nsource = 0\ntarget = 33 # Assuming karate club graph\n\nif G_analysis.has_node(source) and G_analysis.has_node(target):\n try:\n shortest_path = nx.shortest_path(G_analysis, source, target)\n path_length = nx.shortest_path_length(G_analysis, source, target)\n print(f'Shortest path from {source} to {target}: {shortest_path}')\n print(f'Path length: {path_length}')\n except nx.NetworkXNoPath:\n print(f'No path between {source} and {target}')\n\n# All shortest paths lengths\npath_lengths = dict(nx.all_pairs_shortest_path_length(G_analysis))\nprint(f'Average shortest path in network: {np.mean([np.mean(list(lengths.values())) for lengths in path_lengths.values()]):.3f}')\n\n# Graph algorithms\nprint('\\n=== Graph Algorithms ===')\n\n# Minimum spanning tree\nif nx.is_connected(G_analysis):\n mst = nx.minimum_spanning_tree(G_analysis)\n print(f'Minimum spanning tree: {mst.number_of_edges()} edges')\n print(f'MST weight: {mst.size(weight=\"weight\", default=1)}')\n\n# Maximal independent set\nindependent_set = nx.maximal_independent_set(G_analysis)\nprint(f'Maximal independent set size: {len(independent_set)}')\n\n# Graph coloring\ncoloring = nx.greedy_color(G_analysis, strategy='largest_first')\nnum_colors = len(set(coloring.values()))\nprint(f'Graph coloring: {num_colors} colors needed')\n\n# Clique analysis\ncliques = list(nx.find_cliques(G_analysis))\nmax_clique_size = max(len(clique) for clique in cliques)\nprint(f'Maximum clique size: {max_clique_size}')\nprint(f'Number of maximal cliques: {len(cliques)}')\n\n# Directed graph analysis\nprint('\\n=== Directed Graph Analysis ===')\nDG_test = nx.DiGraph()\nDG_test.add_edges_from([(1, 2), (2, 3), (3, 1), (3, 4), (4, 5)])\n\nprint(f'Directed graph: {DG_test.number_of_nodes()} nodes, {DG_test.number_of_edges()} edges')\nprint(f'Is strongly connected: {nx.is_strongly_connected(DG_test)}')\nprint(f'Number of strongly connected components: {nx.number_strongly_connected_components(DG_test)}')\n\n# Strongly connected components\nscc = list(nx.strongly_connected_components(DG_test))\nprint('Strongly connected components:')\nfor i, component in enumerate(scc):\n print(f' Component {i}: {component}')\n\n# Topological sort (for DAGs)\nif nx.is_directed_acyclic_graph(DG_test):\n topo_sort = list(nx.topological_sort(DG_test))\n print(f'Topological sort: {topo_sort}')\nelse:\n print('Graph contains cycles - not a DAG')\n\n# Network flow (create a flow network)\nprint('\\n=== Network Flow ===')\nflow_graph = nx.DiGraph()\nflow_graph.add_edge('s', 'a', capacity=10)\nflow_graph.add_edge('s', 'b', capacity=8)\nflow_graph.add_edge('a', 't', capacity=5)\nflow_graph.add_edge('a', 'b', capacity=3)\nflow_graph.add_edge('b', 't', capacity=12)\n\nmax_flow_value, flow_dict = nx.maximum_flow(flow_graph, 's', 't')\nprint(f'Maximum flow from s to t: {max_flow_value}')\nprint('Flow on edges:')\nfor source in flow_dict:\n for target in flow_dict[source]:\n if flow_dict[source][target] > 0:\n print(f' {source} -> {target}: {flow_dict[source][target]}')\n\n# Graph generators and models\nprint('\\n=== Graph Generators ===')\n\n# Small world networks\nsmall_world = nx.watts_strogatz_graph(30, 4, 0.3)\nprint(f'Small world (30, 4, 0.3): clustering = {nx.average_clustering(small_world):.3f}')\n\n# Scale-free networks\nscale_free_large = nx.barabasi_albert_graph(100, 2)\ndegree_sequence = [d for n, d in scale_free_large.degree()]\nprint(f'Scale-free network: max degree = {max(degree_sequence)}, power law fit')\n\n# Regular graphs\nregular = nx.random_regular_graph(4, 20) # 4-regular graph with 20 nodes\nprint(f'4-regular graph: all nodes have degree {list(regular.degree())[0][1]}')\n\n# Graph I/O\nprint('\\n=== Graph Input/Output ===')\n\n# Save graph in different formats\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.gml', delete=False) as f:\n gml_file = f.name\n nx.write_gml(G_analysis, gml_file)\n\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.graphml', delete=False) as f:\n graphml_file = f.name\n nx.write_graphml(G_analysis, graphml_file)\n\nprint(f'Saved graph to GML format: {gml_file}')\nprint(f'Saved graph to GraphML format: {graphml_file}')\n\n# Read graph back\nG_loaded = nx.read_gml(gml_file)\nprint(f'Loaded graph: {G_loaded.number_of_nodes()} nodes, {G_loaded.number_of_edges()} edges')\n\n# Convert to/from other formats\nadjacency_matrix = nx.to_numpy_array(G_analysis)\nprint(f'Adjacency matrix shape: {adjacency_matrix.shape}')\n\nedge_list = nx.to_edgelist(G_analysis)\nprint(f'Edge list length: {len(edge_list)}')\n\n# Graph visualization preparation\nprint('\\n=== Visualization Setup ===')\npos = nx.spring_layout(G_analysis, seed=42)\nprint(f'Generated layout positions for {len(pos)} nodes')\nprint('Use matplotlib to visualize:')\nprint('plt.figure(figsize=(12, 8))')\nprint('nx.draw(G, pos, with_labels=True, node_color=\"lightblue\")')\nprint('plt.show()')\n\n# Graph statistics summary\nprint('\\n=== Graph Statistics Summary ===')\nstats = {\n 'Nodes': G_analysis.number_of_nodes(),\n 'Edges': G_analysis.number_of_edges(),\n 'Density': nx.density(G_analysis),\n 'Average degree': np.mean([d for n, d in G_analysis.degree()]),\n 'Clustering': nx.average_clustering(G_analysis),\n 'Connected': nx.is_connected(G_analysis)\n}\n\nfor stat, value in stats.items():\n if isinstance(value, float):\n print(f'{stat}: {value:.3f}')\n else:\n print(f'{stat}: {value}')\n\n# Cleanup temporary files\nos.unlink(gml_file)\nos.unlink(graphml_file)\n\nprint('\\nNetworkX provides:')\nprint('• Graph creation and manipulation')\nprint('• Network algorithms and analysis')\nprint('• Centrality and community detection')\nprint('• Shortest paths and flows')\nprint('• Graph generators and models')\nprint('• Import/export various formats')\nprint('• Integration with NumPy and SciPy')\nprint('• Visualization with matplotlib')",
|
|
1460
|
+
"quick_start": [
|
|
1461
|
+
"Install: pip install networkx",
|
|
1462
|
+
"Import: import networkx as nx",
|
|
1463
|
+
"Create: G = nx.Graph()",
|
|
1464
|
+
"Add: G.add_edge(1, 2)",
|
|
1465
|
+
"Analyze: nx.centrality_measures(G)",
|
|
1466
|
+
"Visualize: nx.draw(G)"
|
|
1467
|
+
]
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
"type": "PackageTool",
|
|
1472
|
+
"name": "get_msprime_info",
|
|
1473
|
+
"description": "Get comprehensive information about msprime – coalescent simulation framework",
|
|
1474
|
+
"parameter": {
|
|
1475
|
+
"type": "object",
|
|
1476
|
+
"properties": {
|
|
1477
|
+
"include_examples": {
|
|
1478
|
+
"type": "boolean",
|
|
1479
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
1480
|
+
"default": true
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
},
|
|
1484
|
+
"package_name": "msprime",
|
|
1485
|
+
"local_info": {
|
|
1486
|
+
"name": "msprime",
|
|
1487
|
+
"description": "Efficient coalescent simulation framework for population genetics. Simulates genetic ancestry and generates tree sequences representing evolutionary relationships.",
|
|
1488
|
+
"category": "Population Genetics",
|
|
1489
|
+
"import_name": "msprime",
|
|
1490
|
+
"popularity": 78,
|
|
1491
|
+
"keywords": [
|
|
1492
|
+
"coalescent simulation",
|
|
1493
|
+
"population genetics",
|
|
1494
|
+
"tree sequences",
|
|
1495
|
+
"evolutionary genetics",
|
|
1496
|
+
"ancestry"
|
|
1497
|
+
],
|
|
1498
|
+
"documentation": "https://msprime.readthedocs.io/",
|
|
1499
|
+
"repository": "https://github.com/tskit-dev/msprime",
|
|
1500
|
+
"installation": {
|
|
1501
|
+
"pip": "pip install msprime",
|
|
1502
|
+
"conda": "conda install -c conda-forge msprime"
|
|
1503
|
+
},
|
|
1504
|
+
"usage_example": "import msprime\nimport tskit\n\n# Simulate tree sequence\nts = msprime.sim_ancestry(\n samples=10,\n population_size=1e4,\n sequence_length=1e6,\n recombination_rate=1e-8,\n random_seed=42\n)\n\n# Add mutations\nmts = msprime.sim_mutations(ts, rate=1e-8, random_seed=42)\n\n# Basic statistics\nprint(f'Number of trees: {ts.num_trees}')\nprint(f'Number of samples: {ts.num_samples}')\nprint(f'Number of mutations: {mts.num_mutations}')\nprint(f'Sequence length: {ts.sequence_length}')\n\n# Calculate diversity\ndiversity = mts.diversity()\nprint(f'Diversity: {diversity:.6f}')",
|
|
1505
|
+
"quick_start": [
|
|
1506
|
+
"1. Install msprime: pip install msprime",
|
|
1507
|
+
"2. Import: import msprime",
|
|
1508
|
+
"3. Simulate: ts = msprime.sim_ancestry(samples=10)",
|
|
1509
|
+
"4. Add mutations: mts = msprime.sim_mutations(ts)",
|
|
1510
|
+
"5. Analyze: diversity, statistics"
|
|
1511
|
+
]
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"type": "PackageTool",
|
|
1516
|
+
"name": "get_pymassspec_info",
|
|
1517
|
+
"description": "Get comprehensive information about PyMassSpec – mass spectrometry data analysis",
|
|
1518
|
+
"parameter": {
|
|
1519
|
+
"type": "object",
|
|
1520
|
+
"properties": {
|
|
1521
|
+
"info_type": {
|
|
1522
|
+
"type": "string",
|
|
1523
|
+
"enum": [
|
|
1524
|
+
"overview",
|
|
1525
|
+
"installation",
|
|
1526
|
+
"usage",
|
|
1527
|
+
"documentation"
|
|
1528
|
+
],
|
|
1529
|
+
"description": "Type of information to retrieve about PyMassSpec"
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
"required": [
|
|
1533
|
+
"info_type"
|
|
1534
|
+
]
|
|
1535
|
+
},
|
|
1536
|
+
"package_name": "PyMassSpec",
|
|
1537
|
+
"local_info": {
|
|
1538
|
+
"name": "PyMassSpec",
|
|
1539
|
+
"description": "Python toolkit for mass spectrometry data analysis. Provides functions for reading mass spectra files, peak detection, alignment, and metabolomics/proteomics data processing workflows.",
|
|
1540
|
+
"category": "Mass Spectrometry",
|
|
1541
|
+
"import_name": "pyms",
|
|
1542
|
+
"popularity": 68,
|
|
1543
|
+
"keywords": [
|
|
1544
|
+
"mass spectrometry",
|
|
1545
|
+
"metabolomics",
|
|
1546
|
+
"proteomics",
|
|
1547
|
+
"peak detection",
|
|
1548
|
+
"chromatography"
|
|
1549
|
+
],
|
|
1550
|
+
"documentation": "https://pymassspec.readthedocs.io/",
|
|
1551
|
+
"repository": "https://github.com/PyMassSpec/PyMassSpec",
|
|
1552
|
+
"installation": {
|
|
1553
|
+
"pip": "pip install PyMassSpec",
|
|
1554
|
+
"conda": "conda install -c conda-forge pymassspec"
|
|
1555
|
+
},
|
|
1556
|
+
"usage_example": "from pyms.GCMS.IO.JCAMP import JCAMP_reader\nfrom pyms.GCMS.Function import build_intensity_matrix\nfrom pyms.Noise.SavitzkyGolay import savitzky_golay\nfrom pyms.Peak.Function import peak_sum_area\nimport matplotlib.pyplot as plt\n\n# Read mass spectrometry data\n# data = JCAMP_reader('sample.jdx') # Example file format\n# im = build_intensity_matrix(data)\n\n# For demonstration with synthetic data\nimport numpy as np\ntime_points = np.linspace(0, 1000, 1000)\nintensity = np.exp(-(time_points-500)**2/10000) + 0.1*np.random.normal(size=1000)\n\n# Apply smoothing\nsmoothed = savitzky_golay(intensity, window_size=11, order=3)\n\n# Peak detection (simplified example)\nfrom scipy.signal import find_peaks\npeaks, _ = find_peaks(smoothed, height=0.3, distance=20)\n\nprint(f'Found {len(peaks)} peaks')\nprint(f'Peak positions: {time_points[peaks]}')\n\n# Plot results\nplt.figure(figsize=(12, 6))\nplt.plot(time_points, intensity, 'b-', alpha=0.5, label='Raw')\nplt.plot(time_points, smoothed, 'r-', label='Smoothed')\nplt.plot(time_points[peaks], smoothed[peaks], 'go', label='Peaks')\nplt.xlabel('Retention Time')\nplt.ylabel('Intensity')\nplt.legend()\nplt.title('Mass Spectrometry Peak Detection')\nplt.show()",
|
|
1557
|
+
"quick_start": [
|
|
1558
|
+
"Install: pip install PyMassSpec",
|
|
1559
|
+
"Read data: JCAMP_reader() or ANDI_reader()",
|
|
1560
|
+
"Build intensity matrix: build_intensity_matrix()",
|
|
1561
|
+
"Smooth data: savitzky_golay()",
|
|
1562
|
+
"Detect peaks: use built-in peak detection",
|
|
1563
|
+
"Analyze metabolomics/proteomics workflows"
|
|
1564
|
+
]
|
|
1565
|
+
}
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
"type": "PackageTool",
|
|
1569
|
+
"name": "get_pypdf2_info",
|
|
1570
|
+
"description": "Get comprehensive information about PyPDF2 – PDF manipulation library",
|
|
1571
|
+
"parameter": {
|
|
1572
|
+
"type": "object",
|
|
1573
|
+
"properties": {
|
|
1574
|
+
"info_type": {
|
|
1575
|
+
"type": "string",
|
|
1576
|
+
"enum": [
|
|
1577
|
+
"overview",
|
|
1578
|
+
"installation",
|
|
1579
|
+
"usage",
|
|
1580
|
+
"documentation"
|
|
1581
|
+
],
|
|
1582
|
+
"description": "Type of information to retrieve about PyPDF2"
|
|
1583
|
+
}
|
|
1584
|
+
},
|
|
1585
|
+
"required": [
|
|
1586
|
+
"info_type"
|
|
1587
|
+
]
|
|
1588
|
+
},
|
|
1589
|
+
"package_name": "PyPDF2",
|
|
1590
|
+
"local_info": {
|
|
1591
|
+
"name": "PyPDF2",
|
|
1592
|
+
"description": "Pure-Python library for reading, merging, splitting, and transforming PDF files. Provides functionality for extracting text, metadata, and pages from PDF documents without external dependencies.",
|
|
1593
|
+
"category": "Document Processing / PDF",
|
|
1594
|
+
"import_name": "PyPDF2",
|
|
1595
|
+
"popularity": 82,
|
|
1596
|
+
"keywords": [
|
|
1597
|
+
"PDF",
|
|
1598
|
+
"document processing",
|
|
1599
|
+
"text extraction",
|
|
1600
|
+
"merge",
|
|
1601
|
+
"split",
|
|
1602
|
+
"metadata"
|
|
1603
|
+
],
|
|
1604
|
+
"documentation": "https://pypdf2.readthedocs.io/",
|
|
1605
|
+
"repository": "https://github.com/py-pdf/PyPDF2",
|
|
1606
|
+
"installation": {
|
|
1607
|
+
"pip": "pip install PyPDF2",
|
|
1608
|
+
"conda": "conda install -c conda-forge pypdf2"
|
|
1609
|
+
},
|
|
1610
|
+
"usage_example": "import PyPDF2\nimport io\nfrom reportlab.pdfgen import canvas\nfrom reportlab.lib.pagesizes import letter\n\n# Create a sample PDF for demonstration\nbuffer = io.BytesIO()\nc = canvas.Canvas(buffer, pagesize=letter)\nc.drawString(100, 750, 'This is page 1')\nc.showPage()\nc.drawString(100, 750, 'This is page 2')\nc.showPage()\nc.drawString(100, 750, 'This is page 3')\nc.save()\n\n# Reset buffer position\nbuffer.seek(0)\n\n# Read PDF\nreader = PyPDF2.PdfReader(buffer)\n\nprint(f'Number of pages: {len(reader.pages)}')\nprint(f'PDF metadata: {reader.metadata}')\n\n# Extract text from first page\nif len(reader.pages) > 0:\n first_page = reader.pages[0]\n text = first_page.extract_text()\n print(f'Text from first page: \"{text.strip()}\"')\n\n# Create a new PDF with selected pages\nwriter = PyPDF2.PdfWriter()\n\n# Add pages 1 and 3 (skip page 2)\nwriter.add_page(reader.pages[0]) # Page 1\nif len(reader.pages) > 2:\n writer.add_page(reader.pages[2]) # Page 3\n\n# Save new PDF\noutput_buffer = io.BytesIO()\nwriter.write(output_buffer)\n\nprint(f'Created new PDF with {len(writer.pages)} pages')\n\n# Example: Merge multiple PDFs\nprint('\\nMerging multiple PDFs:')\nmerger = PyPDF2.PdfMerger()\n\n# Add the same PDF multiple times for demo\nbuffer.seek(0)\nmerger.append(buffer)\nbuffer.seek(0)\nmerger.append(buffer)\n\nmerged_buffer = io.BytesIO()\nmerger.write(merged_buffer)\nmerger.close()\n\nprint('PDFs merged successfully')\n\n# Read the merged PDF\nmerged_buffer.seek(0)\nmerged_reader = PyPDF2.PdfReader(merged_buffer)\nprint(f'Merged PDF has {len(merged_reader.pages)} pages')",
|
|
1611
|
+
"quick_start": [
|
|
1612
|
+
"Install: pip install PyPDF2",
|
|
1613
|
+
"Read PDF: reader = PyPDF2.PdfReader('file.pdf')",
|
|
1614
|
+
"Extract text: page.extract_text()",
|
|
1615
|
+
"Create writer: writer = PyPDF2.PdfWriter()",
|
|
1616
|
+
"Add pages: writer.add_page(page)",
|
|
1617
|
+
"Merge PDFs: PyPDF2.PdfMerger()"
|
|
1618
|
+
]
|
|
1619
|
+
}
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
"type": "PackageTool",
|
|
1623
|
+
"name": "get_pytdc_info",
|
|
1624
|
+
"description": "Get comprehensive information about PyTDC – Therapeutics Data Commons in Python",
|
|
1625
|
+
"parameter": {
|
|
1626
|
+
"type": "object",
|
|
1627
|
+
"properties": {
|
|
1628
|
+
"info_type": {
|
|
1629
|
+
"type": "string",
|
|
1630
|
+
"enum": [
|
|
1631
|
+
"overview",
|
|
1632
|
+
"installation",
|
|
1633
|
+
"usage",
|
|
1634
|
+
"datasets",
|
|
1635
|
+
"documentation"
|
|
1636
|
+
],
|
|
1637
|
+
"description": "Type of information to retrieve about PyTDC"
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
"required": [
|
|
1641
|
+
"info_type"
|
|
1642
|
+
]
|
|
1643
|
+
},
|
|
1644
|
+
"package_name": "pytdc",
|
|
1645
|
+
"local_info": {
|
|
1646
|
+
"name": "PyTDC",
|
|
1647
|
+
"description": "Python interface to Therapeutics Data Commons (TDC), a comprehensive collection of curated datasets and benchmarks for drug discovery and development. Provides easy access to ADMET, toxicity, and bioactivity data.",
|
|
1648
|
+
"category": "Drug Discovery / Datasets",
|
|
1649
|
+
"import_name": "tdc",
|
|
1650
|
+
"popularity": 72,
|
|
1651
|
+
"keywords": [
|
|
1652
|
+
"therapeutics",
|
|
1653
|
+
"drug discovery",
|
|
1654
|
+
"ADMET",
|
|
1655
|
+
"toxicity",
|
|
1656
|
+
"bioactivity",
|
|
1657
|
+
"benchmarks"
|
|
1658
|
+
],
|
|
1659
|
+
"documentation": "https://tdc.readthedocs.io/",
|
|
1660
|
+
"repository": "https://github.com/mims-harvard/TDC",
|
|
1661
|
+
"installation": {
|
|
1662
|
+
"pip": "pip install PyTDC",
|
|
1663
|
+
"conda": "conda install -c conda-forge pytdc"
|
|
1664
|
+
},
|
|
1665
|
+
"usage_example": "from tdc import Evaluator\nfrom tdc.single_pred import ADME, Tox\nfrom tdc.multi_pred import DTI\nimport pandas as pd\n\n# Load ADME dataset (e.g., Caco-2 permeability)\ndata = ADME(name='Caco2_Wang')\nsplit = data.get_split()\nprint(f'Train set size: {len(split[\"train\"])}')\nprint(f'Test set size: {len(split[\"test\"])}')\n\n# Load toxicity dataset\ntox_data = Tox(name='hERG')\ntox_split = tox_data.get_split()\nprint(f'Toxicity data shape: {tox_split[\"train\"].shape}')\n\n# Load drug-target interaction dataset\ndti_data = DTI(name='Davis')\ndti_split = dti_data.get_split()\nprint(f'DTI train size: {len(dti_split[\"train\"])}')\n\n# Use evaluator for model assessment\nevaluator = Evaluator(name='ROC-AUC')\n# predictions = model.predict(test_data) # Your model predictions\n# score = evaluator(test_labels, predictions)\nprint('Available evaluators:', Evaluator.list_evaluator())",
|
|
1666
|
+
"quick_start": [
|
|
1667
|
+
"Install: pip install PyTDC",
|
|
1668
|
+
"Load ADME data: ADME(name='Caco2_Wang')",
|
|
1669
|
+
"Load toxicity data: Tox(name='hERG')",
|
|
1670
|
+
"Load DTI data: DTI(name='Davis')",
|
|
1671
|
+
"Get data splits: data.get_split()",
|
|
1672
|
+
"Evaluate models: Evaluator(name='ROC-AUC')"
|
|
1673
|
+
]
|
|
1674
|
+
}
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
"type": "PackageTool",
|
|
1678
|
+
"name": "get_lifelines_info",
|
|
1679
|
+
"description": "Get comprehensive information about lifelines – survival analysis in Python",
|
|
1680
|
+
"parameter": {
|
|
1681
|
+
"type": "object",
|
|
1682
|
+
"properties": {
|
|
1683
|
+
"include_examples": {
|
|
1684
|
+
"type": "boolean",
|
|
1685
|
+
"description": "Whether to include usage examples and quick start guide",
|
|
1686
|
+
"default": true
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
},
|
|
1690
|
+
"package_name": "lifelines",
|
|
1691
|
+
"local_info": {
|
|
1692
|
+
"name": "lifelines",
|
|
1693
|
+
"description": "Complete survival analysis library for Python. Includes implementations of popular survival models like Cox proportional hazards, accelerated failure time models, and non-parametric estimators.",
|
|
1694
|
+
"category": "Survival Analysis",
|
|
1695
|
+
"import_name": "lifelines",
|
|
1696
|
+
"popularity": 80,
|
|
1697
|
+
"keywords": [
|
|
1698
|
+
"survival analysis",
|
|
1699
|
+
"kaplan-meier",
|
|
1700
|
+
"cox regression",
|
|
1701
|
+
"hazard models",
|
|
1702
|
+
"time-to-event"
|
|
1703
|
+
],
|
|
1704
|
+
"documentation": "https://lifelines.readthedocs.io/",
|
|
1705
|
+
"repository": "https://github.com/CamDavidsonPilon/lifelines",
|
|
1706
|
+
"installation": {
|
|
1707
|
+
"pip": "pip install lifelines",
|
|
1708
|
+
"conda": "conda install -c conda-forge lifelines"
|
|
1709
|
+
},
|
|
1710
|
+
"usage_example": "from lifelines import KaplanMeierFitter, CoxPHFitter\nimport pandas as pd\n\n# Kaplan-Meier survival analysis\nkmf = KaplanMeierFitter()\nT = [1, 2, 3, 4, 5, 6] # duration\nE = [1, 0, 1, 1, 0, 1] # event occurred\nkmf.fit(T, E)\nkmf.plot_survival_function()\n\n# Cox proportional hazards model\ncph = CoxPHFitter()\ndf = pd.DataFrame({'T': T, 'E': E, 'age': [25, 30, 35, 40, 45, 50]})\ncph.fit(df, duration_col='T', event_col='E')\nprint(cph.summary)",
|
|
1711
|
+
"quick_start": [
|
|
1712
|
+
"1. Install lifelines: pip install lifelines",
|
|
1713
|
+
"2. Import: from lifelines import KaplanMeierFitter",
|
|
1714
|
+
"3. Fit model: kmf = KaplanMeierFitter(); kmf.fit(T, E)",
|
|
1715
|
+
"4. Plot curves: kmf.plot_survival_function()",
|
|
1716
|
+
"5. Cox regression: CoxPHFitter().fit(data)"
|
|
1717
|
+
]
|
|
1718
|
+
}
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
"type": "PackageTool",
|
|
1722
|
+
"name": "get_bioservices_info",
|
|
1723
|
+
"description": "Get information about the bioservices package. Python package: bioservices",
|
|
1724
|
+
"package_name": "bioservices",
|
|
1725
|
+
"parameter": {
|
|
1726
|
+
"type": "object",
|
|
1727
|
+
"properties": {},
|
|
1728
|
+
"required": []
|
|
1729
|
+
},
|
|
1730
|
+
"required": []
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
"type": "PackageTool",
|
|
1734
|
+
"name": "get_ete3_info",
|
|
1735
|
+
"description": "Get information about the ete3 package. Python package: ete3",
|
|
1736
|
+
"package_name": "ete3",
|
|
1737
|
+
"parameter": {
|
|
1738
|
+
"type": "object",
|
|
1739
|
+
"properties": {},
|
|
1740
|
+
"required": []
|
|
1741
|
+
},
|
|
1742
|
+
"required": []
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
"type": "PackageTool",
|
|
1746
|
+
"name": "get_dendropy_info",
|
|
1747
|
+
"description": "Get information about the dendropy package. Python package: dendropy",
|
|
1748
|
+
"package_name": "dendropy",
|
|
1749
|
+
"parameter": {
|
|
1750
|
+
"type": "object",
|
|
1751
|
+
"properties": {},
|
|
1752
|
+
"required": []
|
|
1753
|
+
},
|
|
1754
|
+
"required": []
|
|
1755
|
+
}
|
|
1756
|
+
]
|