AF3 templates: fix mmCIF parsing by removing synthetic _entity_poly_seq and mapping only present residues

- Strip _entity_poly_seq from generated template mmCIF so AF3 reconstructs _pdbx_poly_seq_scheme from _atom_site, avoiding UNK/gap mismatches
- Build query_to_template_map using only residues with atoms to prevent OOB indexing in template features
- Add --debug_templates flag to optionally dump generated template mmCIFs into templates_debug/
- Keep templates enabled; test test__chopped_dimer now passes
This commit is contained in:
Dima
2025-08-12 14:04:33 +02:00
parent 627f8480f5
commit fc41c1a5eb
20823 changed files with 3122676 additions and 6 deletions

BIN
.coverage Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}

663
af3x _input_generator.html Normal file
View File

@@ -0,0 +1,663 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AF3x JSON Input Generator</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; margin: 20px; background-color: #f4f7f9; color: #333; }
.container { max-width: 900px; margin: auto; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 15px rgba(0,0,0,0.1); }
h1, h2, h3, h4, h5 { color: #2c3e50; }
.section { border: 1px solid #e0e0e0; padding: 15px; margin-bottom: 20px; border-radius: 5px; background-color: #fdfdfd; }
.section h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
label { display: block; margin-top: 12px; font-weight: 600; font-size: 0.95em; margin-bottom: 3px; }
input[type="text"], input[type="number"], textarea, select { width: calc(100% - 18px); padding: 9px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 0.95em; }
textarea { min-height: 70px; resize: vertical; }
button, .button-link { padding: 9px 18px; background-color: #3498db; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 10px; font-size: 0.95em; transition: background-color 0.2s ease; text-decoration: none; display: inline-block; text-align: center;}
button:hover, .button-link:hover { background-color: #2980b9; }
.remove-btn { background-color: #e74c3c; margin-left: 10px; }
.remove-btn:hover { background-color: #c0392b; }
.add-btn { background-color: #2ecc71; }
.add-btn:hover { background-color: #27ae60; }
.toggle-btn { background-color: #95a5a6; font-size: 0.85em; padding: 6px 12px; margin-bottom:10px; }
.toggle-btn:hover { background-color: #7f8c8d; }
.subsection { border: 1px dashed #d0d0d0; padding: 12px; margin-top: 12px; border-radius: 4px; background-color: #f9f9f9; }
.optional-parameters { display: none; border-top: 1px solid #eee; margin-top: 10px; padding-top:10px;}
.info { font-size: 0.85em; color: #555; margin-bottom: 10px; padding: 8px; background-color: #ecf0f1; border-radius: 3px; border-left: 3px solid #3498db;}
#jsonOutput { background-color: #2c3e50; color: #f8f8f2; border: 1px solid #444; padding: 15px; white-space: pre-wrap; word-break: break-all; border-radius: 4px; max-height: 500px; overflow-y: auto; font-family: "Courier New", Courier, monospace; }
#generateJsonBtn { background-color: #16a085; padding: 12px 25px; font-size: 1.05em; }
#generateJsonBtn:hover { background-color: #117a65; }
.action-buttons button, .action-buttons a.button-link { margin-right: 10px; }
.crosslink-residue-pair-entry > div { margin-bottom: 5px;}
.crosslink-residue-pair-entry label {font-size: 0.9em; margin-top: 5px;}
</style>
</head>
<body>
<div class="container">
<h1>AF3x JSON Input Generator</h1>
<div class="section" id="general-info">
<h3>General Information</h3>
<label for="jobName">Job Name:</label>
<input type="text" id="jobName" name="jobName" placeholder="e.g., MyProteinLigandComplex", value="test_name">
<label for="modelSeeds">Model Seeds (comma-separated):</label>
<input type="text" id="modelSeeds" name="modelSeeds" value="1" required>
<div class="info">At least one seed required. E.g., 1,2,3</div>
<input type="hidden" id="dialect" name="dialect" value="alphafold3">
<label for="version">Input Version:</label>
<input type="number" id="version" name="version" value="3">
<div class="info">Version 3 supports all current features (including userCCDPath). Crosslinks are assumed compatible.</div>
</div>
<div class="section" id="sequences-section">
<h3>Sequences</h3>
<div id="sequences-container">
</div>
<button type="button" id="addSequenceBtn" class="add-btn">Add Sequence Entity</button>
</div>
<div class="section" id="crosslinks-section">
<h3>Crosslinks (Optional, AF3x Syntax)</h3>
<div class="info">Define crosslinks between residues. Each crosslink group has a name and one or more residue pairs.</div>
<div id="crosslinks-container">
</div>
<button type="button" id="addCrosslinkGroupBtn" class="add-btn">Add Crosslink Group</button>
</div>
<div class="section" id="bonds-section">
<h3>Bonded Atom Pairs (Optional)</h3>
<div class="info">Define covalent bonds (e.g., for covalent ligands or glycans). Not for SMILES-defined ligands. Each atom is addressed by Entity ID, 1-based Residue ID, and Atom Name.</div>
<div id="bondedAtomPairs-container">
</div>
<button type="button" id="addBondBtn" class="add-btn">Add Bond</button>
</div>
<div class="section" id="user-ccd-section">
<h3>User-Provided CCD (Optional, Expert)</h3>
<div class="info">For custom ligands not in standard CCD, especially if they need to be bonded or require specific conformers. Provide either inline CCD content OR a path to a CCD file (mutually exclusive).</div>
<label for="userCCD">User CCD (mmCIF format, inline string):</label>
<textarea id="userCCD" name="userCCD" placeholder="Paste mmCIF content here. Remember to use '\n' for newlines within the JSON string if manually editing."></textarea>
<div class="info">If pasting directly, ensure newlines are actual newlines. The JSON generator will handle escaping if this textarea has literal newlines. For mmCIF syntax: use single quotes for strings like chemical formulas if issues arise.</div>
<label for="userCCDPath">User CCD Path (path to .cif, .cif.gz, .cif.xz, .cif.zst):</label>
<input type="text" id="userCCDPath" name="userCCDPath" placeholder="/path/to/your/custom_ccd.cif">
</div>
<button type="button" id="generateJsonBtn">Generate JSON</button>
<div class="section" id="output-section" style="margin-top: 30px;">
<h3>Generated JSON Output</h3>
<div class="action-buttons">
<button type="button" id="copyJsonBtn" style="display:none;">Copy JSON</button>
<a id="downloadJsonLink" class="button-link" style="display:none;" download="alphafold3_input.json">Download JSON</a>
</div>
<pre id="jsonOutput"></pre>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const sequencesContainer = document.getElementById('sequences-container');
const addSequenceBtn = document.getElementById('addSequenceBtn');
const bondedAtomPairsContainer = document.getElementById('bondedAtomPairs-container');
const addBondBtn = document.getElementById('addBondBtn');
const crosslinksContainer = document.getElementById('crosslinks-container');
const addCrosslinkGroupBtn = document.getElementById('addCrosslinkGroupBtn');
const generateJsonBtn = document.getElementById('generateJsonBtn');
const jsonOutputEl = document.getElementById('jsonOutput');
const copyJsonBtn = document.getElementById('copyJsonBtn');
const downloadJsonLink = document.getElementById('downloadJsonLink');
let entityCounter = 0;
let crosslinkGroupCounter = 0;
function createInputGroup(labelText, inputType, inputName, inputPlaceholder, defaultValue = '', isTextarea = false, options = null, required = false, customClass = '', infoText = null) {
const groupDiv = document.createElement('div');
groupDiv.className = 'input-group';
const label = document.createElement('label');
label.textContent = labelText + (required ? '*' : '');
label.htmlFor = inputName;
groupDiv.appendChild(label);
let input;
if (isTextarea) {
input = document.createElement('textarea');
} else if (options) {
input = document.createElement('select');
options.forEach(opt => {
const option = document.createElement('option');
option.value = opt.value;
option.textContent = opt.label;
input.appendChild(option);
});
} else {
input = document.createElement('input');
input.type = inputType;
}
input.name = inputName;
input.id = inputName;
input.placeholder = inputPlaceholder;
input.value = defaultValue;
if (required) input.required = true;
if (customClass) input.className = customClass;
groupDiv.appendChild(input);
if (infoText) {
const infoDiv = document.createElement('div');
infoDiv.className = 'info';
infoDiv.innerHTML = infoText; // Use innerHTML for potential HTML in infoText
groupDiv.appendChild(infoDiv);
}
return { groupDiv, inputEl: input };
}
function createRemoveButton(targetDiv, text = 'Remove') {
const removeBtn = document.createElement('button');
removeBtn.type = 'button';
removeBtn.textContent = text;
removeBtn.className = 'remove-btn';
removeBtn.onclick = () => targetDiv.remove();
return removeBtn;
}
function createToggleButton(targetDiv, showText = 'Show Optional Parameters', hideText = 'Hide Optional Parameters') {
const toggleBtn = document.createElement('button');
toggleBtn.type = 'button';
toggleBtn.textContent = showText;
toggleBtn.className = 'toggle-btn';
toggleBtn.onclick = () => {
const isHidden = targetDiv.style.display === 'none';
targetDiv.style.display = isHidden ? 'block' : 'none';
toggleBtn.textContent = isHidden ? hideText : showText;
};
return toggleBtn;
}
addSequenceBtn.addEventListener('click', () => {
entityCounter++;
const uniqueId = `entity_${entityCounter}`;
const sequenceDiv = document.createElement('div');
sequenceDiv.className = 'subsection sequence-entry';
sequenceDiv.dataset.entityId = uniqueId;
const header = document.createElement('h4');
header.textContent = `Sequence Entity ${sequencesContainer.children.length + 1}`;
sequenceDiv.appendChild(header);
const typeSelectorGroup = createInputGroup(
'Sequence Type:', 'select', `seq_type_${uniqueId}`, '', 'protein', false,
[
{ value: 'protein', label: 'Protein' }, { value: 'rna', label: 'RNA' },
{ value: 'dna', label: 'DNA' }, { value: 'ligand', label: 'Ligand' }
], true, 'seq-type-selector'
);
sequenceDiv.appendChild(typeSelectorGroup.groupDiv);
// --- Required fields container ---
const requiredFieldsContainer = document.createElement('div');
requiredFieldsContainer.className = 'sequence-required-fields';
sequenceDiv.appendChild(requiredFieldsContainer);
// --- Optional fields container (collapsible) ---
const optionalFieldsDiv = document.createElement('div');
optionalFieldsDiv.className = 'optional-parameters'; // Initially hidden by CSS if desired
optionalFieldsDiv.id = `optional_params_${uniqueId}`;
const toggleBtn = createToggleButton(optionalFieldsDiv);
sequenceDiv.appendChild(toggleBtn);
sequenceDiv.appendChild(optionalFieldsDiv);
typeSelectorGroup.inputEl.onchange = () => renderSequenceFields(requiredFieldsContainer, optionalFieldsDiv, typeSelectorGroup.inputEl.value, uniqueId);
renderSequenceFields(requiredFieldsContainer, optionalFieldsDiv, 'protein', uniqueId); // Initial render
sequenceDiv.appendChild(createRemoveButton(sequenceDiv, 'Remove Entity'));
sequencesContainer.appendChild(sequenceDiv);
});
function renderSequenceFields(reqContainer, optContainer, type, uniqueId) {
reqContainer.innerHTML = ''; // Clear previous required fields
optContainer.innerHTML = ''; // Clear previous optional fields
reqContainer.appendChild(createInputGroup('Entity ID(s):', 'text', `seq_id_${uniqueId}`, 'A or A,B,C (for homomers)', '', false, null, true, '', 'Unique ID for this entity. Use comma-separation for multiple copies of a homomer (e.g., A,B).').groupDiv);
if (type === 'protein' || type === 'rna' || type === 'dna') {
reqContainer.appendChild(createInputGroup('Sequence:', 'text', `seq_sequence_${uniqueId}`, `Enter ${type.toUpperCase()} sequence`, '', true, null, true).groupDiv);
const modificationsContainer = document.createElement('div');
modificationsContainer.className = 'modifications-sub-container';
modificationsContainer.innerHTML = '<h5>Modifications (Optional)</h5>';
optContainer.appendChild(modificationsContainer);
const addModBtn = document.createElement('button');
addModBtn.type = 'button';
addModBtn.textContent = 'Add Modification';
addModBtn.className = 'add-btn';
addModBtn.onclick = () => addModificationField(modificationsContainer, type, uniqueId);
optContainer.appendChild(addModBtn);
}
if (type === 'protein' || type === 'rna') {
const msaHeader = document.createElement('h5');
msaHeader.textContent = 'Multiple Sequence Alignment (MSA, Optional)';
optContainer.appendChild(msaHeader);
optContainer.appendChild(createInputGroup('Unpaired MSA (A3M content):', 'text', `seq_unpairedMsa_${uniqueId}`, 'Paste A3M string or leave blank', '', true, null, false, '', 'Mutually exclusive with Unpaired MSA Path. If all MSA fields for a protein are blank, MSAs will be omitted (AF3 builds them).').groupDiv);
optContainer.appendChild(createInputGroup('Unpaired MSA Path:', 'text', `seq_unpairedMsaPath_${uniqueId}`, '/path/to/unpaired.a3m', '', false, null, false, '', 'Mutually exclusive with Unpaired MSA content.').groupDiv);
}
if (type === 'protein') {
optContainer.appendChild(createInputGroup('Paired MSA (A3M content):', 'text', `seq_pairedMsa_${uniqueId}`, 'Paste A3M string or leave blank/set to ""', '', true, null, false, '', 'Mutually exclusive with Paired MSA Path. For proteins, if unpaired MSA is set and this is blank, it defaults to "".').groupDiv);
optContainer.appendChild(createInputGroup('Paired MSA Path:', 'text', `seq_pairedMsaPath_${uniqueId}`, '/path/to/paired.a3m', '', false, null, false, '', 'Mutually exclusive with Paired MSA content.').groupDiv);
const templatesHeader = document.createElement('h5');
templatesHeader.textContent = 'Structural Templates (Optional)';
optContainer.appendChild(templatesHeader);
const templatesInfo = document.createElement('div');
templatesInfo.className = 'info';
templatesInfo.innerHTML = 'Provide mmCIF (content or path) and 0-based query/template residue indices. If this section is present and no valid templates are defined, it implies `templates: []` (template-free). If this whole "Structural Templates" section is empty for a protein (no template items added), the `templates` field will be omitted, and AF3 will search for templates.';
optContainer.appendChild(templatesInfo);
const templatesContainer = document.createElement('div');
templatesContainer.className = 'templates-sub-container';
optContainer.appendChild(templatesContainer);
const addTemplateBtn = document.createElement('button');
addTemplateBtn.type = 'button';
addTemplateBtn.className = 'add-btn';
addTemplateBtn.textContent = 'Add Template';
addTemplateBtn.onclick = () => addTemplateField(templatesContainer, uniqueId);
optContainer.appendChild(addTemplateBtn);
}
if (type === 'ligand') {
reqContainer.appendChild(createInputGroup('CCD Codes (comma-separated):', 'text', `seq_ccdCodes_${uniqueId}`, 'e.g., ATP,ADP', '', false, null, false, '', 'Mutually exclusive with SMILES. At least one of CCD/SMILES is required for a ligand.').groupDiv);
reqContainer.appendChild(createInputGroup('SMILES String:', 'text', `seq_smiles_${uniqueId}`, 'e.g., CC(=O)OC1C[NH+]2CCC1CC2', '', false, null, false, '', 'Mutually exclusive with CCD Codes. Ensure backslashes are JSON-escaped if needed (e.g., \\\\ becomes \\\\\\\\ in the final JSON). Cannot specify covalent bonds with SMILES.').groupDiv);
}
}
function addModificationField(container, seqType, parentId) {
const modCount = container.querySelectorAll('.modification-entry').length;
const modDiv = document.createElement('div');
modDiv.className = 'subsection modification-entry';
modDiv.innerHTML = `<h6>Modification ${modCount + 1}</h6>`;
const typeLabel = seqType === 'protein' ? 'PTM Type (CCD Code)' : 'Modification Type (CCD Code)';
const posLabel = seqType === 'protein' ? 'PTM Position (1-based)' : 'Base Position (1-based)';
modDiv.appendChild(createInputGroup(typeLabel + ':', 'text', `mod_type_${parentId}_${modCount}`, 'e.g., HY3 or 2MG', '', false, null, true).groupDiv);
const posGroup = createInputGroup(posLabel + ':', 'number', `mod_pos_${parentId}_${modCount}`, 'e.g., 1', '', false, null, true);
posGroup.inputEl.min = "1";
modDiv.appendChild(posGroup.groupDiv);
modDiv.appendChild(createRemoveButton(modDiv));
container.appendChild(modDiv);
}
function addTemplateField(container, parentId) {
const tplCount = container.querySelectorAll('.template-entry').length;
const templateDiv = document.createElement('div');
templateDiv.className = 'subsection template-entry';
templateDiv.innerHTML = `<h6>Template ${tplCount + 1}</h6>`;
templateDiv.appendChild(createInputGroup('mmCIF Content (string):', 'text', `tpl_mmcif_${parentId}_${tplCount}`, 'Paste mmCIF string', '', true, null, false, '', 'Mutually exclusive with mmCIF Path.').groupDiv);
templateDiv.appendChild(createInputGroup('mmCIF Path:', 'text', `tpl_mmcifPath_${parentId}_${tplCount}`, '/path/to/template.cif', '', false, null, false, '', 'Mutually exclusive with mmCIF Content.').groupDiv);
templateDiv.appendChild(createInputGroup('Query Indices (0-based, comma-separated):', 'text', `tpl_queryIndices_${parentId}_${tplCount}`, 'e.g., 0,1,2,5', '', false, null, true).groupDiv);
templateDiv.appendChild(createInputGroup('Template Indices (0-based, comma-separated):', 'text', `tpl_templateIndices_${parentId}_${tplCount}`, 'e.g., 0,1,2,8', '', false, null, true).groupDiv);
templateDiv.appendChild(createRemoveButton(templateDiv));
container.appendChild(templateDiv);
}
addBondBtn.addEventListener('click', () => {
entityCounter++; // Use a general counter for unique element IDs
const bondIdSuffix = `bond_${entityCounter}`;
const bondDiv = document.createElement('div');
bondDiv.className = 'subsection bond-entry';
bondDiv.dataset.bondIdSuffix = bondIdSuffix;
bondDiv.innerHTML = `<h6>Bond ${bondedAtomPairsContainer.querySelectorAll('.bond-entry').length + 1}</h6>`;
const sourceAtomDiv = document.createElement('div');
sourceAtomDiv.innerHTML = '<strong>Source Atom:</strong>';
sourceAtomDiv.appendChild(createInputGroup('Entity ID:', 'text', `bond_src_entity_${bondIdSuffix}`, 'e.g., A', '', false, null, true).groupDiv);
const srcResGroup = createInputGroup('Residue ID (1-based):', 'number', `bond_src_res_${bondIdSuffix}`, 'e.g., 145', '', false, null, true);
srcResGroup.inputEl.min = "1";
sourceAtomDiv.appendChild(srcResGroup.groupDiv);
sourceAtomDiv.appendChild(createInputGroup('Atom Name:', 'text', `bond_src_atom_${bondIdSuffix}`, 'e.g., SG', '', false, null, true).groupDiv);
bondDiv.appendChild(sourceAtomDiv);
const destAtomDiv = document.createElement('div');
destAtomDiv.innerHTML = '<strong>Destination Atom:</strong>';
destAtomDiv.appendChild(createInputGroup('Entity ID:', 'text', `bond_dest_entity_${bondIdSuffix}`, 'e.g., L', '', false, null, true).groupDiv);
const destResGroup = createInputGroup('Residue ID (1-based):', 'number', `bond_dest_res_${bondIdSuffix}`, 'e.g., 1', '', false, null, true);
destResGroup.inputEl.min = "1";
destAtomDiv.appendChild(destResGroup.groupDiv);
destAtomDiv.appendChild(createInputGroup('Atom Name:', 'text', `bond_dest_atom_${bondIdSuffix}`, 'e.g., C04', '', false, null, true).groupDiv);
bondDiv.appendChild(destAtomDiv);
bondDiv.appendChild(createRemoveButton(bondDiv));
bondedAtomPairsContainer.appendChild(bondDiv);
});
addCrosslinkGroupBtn.addEventListener('click', () => {
crosslinkGroupCounter++;
const groupIdSuffix = `cl_group_${crosslinkGroupCounter}`;
const groupDiv = document.createElement('div');
groupDiv.className = 'subsection crosslink-group-entry';
groupDiv.dataset.groupIdSuffix = groupIdSuffix;
groupDiv.innerHTML = `<h4>Crosslink Group ${crosslinksContainer.querySelectorAll('.crosslink-group-entry').length + 1}</h4>`;
groupDiv.appendChild(createInputGroup('Group Name:', 'text', `cl_group_name_${groupIdSuffix}`, 'e.g., azide-A-DSBSO', '', false, null, true).groupDiv);
const residuePairsContainer = document.createElement('div');
residuePairsContainer.className = 'crosslink-residue-pairs-container';
residuePairsContainer.id = `cl_pairs_container_${groupIdSuffix}`;
groupDiv.appendChild(residuePairsContainer);
const addPairBtn = document.createElement('button');
addPairBtn.type = 'button';
addPairBtn.textContent = 'Add Residue Pair';
addPairBtn.className = 'add-btn';
addPairBtn.onclick = () => addCrosslinkResiduePairField(residuePairsContainer, groupIdSuffix);
groupDiv.appendChild(addPairBtn);
groupDiv.appendChild(createRemoveButton(groupDiv, 'Remove Crosslink Group'));
crosslinksContainer.appendChild(groupDiv);
addCrosslinkResiduePairField(residuePairsContainer, groupIdSuffix); // Add one pair by default
});
function addCrosslinkResiduePairField(pairsContainer, groupIdSuffix) {
const pairCount = pairsContainer.querySelectorAll('.crosslink-residue-pair-entry').length;
const pairIdSuffix = `${groupIdSuffix}_pair_${pairCount}`;
const pairDiv = document.createElement('div');
pairDiv.className = 'subsection crosslink-residue-pair-entry';
pairDiv.innerHTML = `<h5>Residue Pair ${pairCount + 1}</h5>`;
pairDiv.appendChild(createInputGroup('Chain A ID:', 'text', `cl_${pairIdSuffix}_chainA_id`, 'A', '', false, null, true).groupDiv);
pairDiv.appendChild(createInputGroup('Residue A Index:', 'number', `cl_${pairIdSuffix}_resA_idx`, '104', '', false, null, true).groupDiv);
pairDiv.appendChild(createInputGroup('Chain B ID:', 'text', `cl_${pairIdSuffix}_chainB_id`, 'B', '', false, null, true).groupDiv);
pairDiv.appendChild(createInputGroup('Residue B Index:', 'number', `cl_${pairIdSuffix}_resB_idx`, '43', '', false, null, true).groupDiv);
pairDiv.appendChild(createRemoveButton(pairDiv, 'Remove Pair'));
pairsContainer.appendChild(pairDiv);
}
generateJsonBtn.addEventListener('click', () => {
try {
const output = {
dialect: "alphafold3",
version: parseInt(document.getElementById('version').value) || 3
};
const jobName = document.getElementById('jobName').value;
if (jobName) output.name = jobName;
const modelSeedsRaw = document.getElementById('modelSeeds').value;
if (!modelSeedsRaw) {
alert("Model Seeds are required."); return;
}
const modelSeeds = modelSeedsRaw.split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
if (modelSeeds.length === 0) {
alert("Valid Model Seeds are required (e.g., 1 or 1,2)."); return;
}
output.modelSeeds = modelSeeds;
output.sequences = [];
const sequenceEntries = document.querySelectorAll('.sequence-entry');
if (sequenceEntries.length === 0) {
alert("At least one sequence entity is required."); return;
}
sequenceEntries.forEach((seqDiv, idx) => {
const entityId = seqDiv.dataset.entityId;
const type = seqDiv.querySelector(`select[name="seq_type_${entityId}"]`).value;
const currentEntity = {};
currentEntity[type] = {};
const idInputValue = seqDiv.querySelector(`input[name="seq_id_${entityId}"]`).value.trim();
if (!idInputValue) throw new Error(`Entity ID is required for sequence entity ${idx + 1}.`);
if (idInputValue.includes(',')) {
currentEntity[type].id = idInputValue.split(',').map(s => s.trim()).filter(Boolean);
if(currentEntity[type].id.length === 0) throw new Error(`Valid Entity ID(s) are required for sequence entity ${idx + 1}.`);
} else {
currentEntity[type].id = idInputValue;
}
if (type === 'protein' || type === 'rna' || type === 'dna') {
const sequenceStr = seqDiv.querySelector(`textarea[name="seq_sequence_${entityId}"]`).value.trim();
if (!sequenceStr) throw new Error(`Sequence string is required for ${type} entity "${currentEntity[type].id}".`);
currentEntity[type].sequence = sequenceStr;
const modifications = [];
seqDiv.querySelectorAll('.modification-entry').forEach(modDiv => {
const modType = modDiv.querySelector(`input[name^="mod_type_${entityId}"]`).value.trim();
const modPos = modDiv.querySelector(`input[name^="mod_pos_${entityId}"]`).value.trim();
if (modType && modPos) {
const mod = {};
if (type === 'protein') {
mod.ptmType = modType;
mod.ptmPosition = parseInt(modPos);
} else { // RNA or DNA
mod.modificationType = modType;
mod.basePosition = parseInt(modPos);
}
modifications.push(mod);
} else if (modType || modPos) { // If one is filled but not the other
throw new Error(`Incomplete modification for ${type} entity "${currentEntity[type].id}". Both type and position are required.`);
}
});
if (modifications.length > 0) currentEntity[type].modifications = modifications;
}
if (type === 'protein') {
// Clear previous MSA fields to handle re-generation correctly
delete currentEntity[type].unpairedMsa; delete currentEntity[type].unpairedMsaPath;
delete currentEntity[type].pairedMsa; delete currentEntity[type].pairedMsaPath;
let up_path_val = seqDiv.querySelector(`input[name="seq_unpairedMsaPath_${entityId}"]`).value.trim();
let up_content_val = seqDiv.querySelector(`textarea[name="seq_unpairedMsa_${entityId}"]`).value; // Raw value
let p_path_val = seqDiv.querySelector(`input[name="seq_pairedMsaPath_${entityId}"]`).value.trim();
let p_content_val = seqDiv.querySelector(`textarea[name="seq_pairedMsa_${entityId}"]`).value; // Raw value
// If all four MSA inputs are empty strings (after trim for paths), then no MSA fields are set.
if (!up_path_val && up_content_val === "" && !p_path_val && p_content_val === "") {
// All MSA inputs are effectively blank, so omit all MSA fields for AF3 to build.
} else {
// At least one MSA input has a value or path.
let unpairedIsSet = false;
if (up_path_val) {
if (up_content_val !== "") throw new Error(`Protein "${currentEntity[type].id}": Unpaired MSA content and path are mutually exclusive.`);
currentEntity[type].unpairedMsaPath = up_path_val;
unpairedIsSet = true;
} else { // Path is empty, consider content (which can be "")
currentEntity[type].unpairedMsa = up_content_val;
unpairedIsSet = true; // "Set" even if it's to ""
}
let pairedIsSet = false;
if (p_path_val) {
if (p_content_val !== "") throw new Error(`Protein "${currentEntity[type].id}": Paired MSA content and path are mutually exclusive.`);
currentEntity[type].pairedMsaPath = p_path_val;
pairedIsSet = true;
} else { // Path is empty
currentEntity[type].pairedMsa = p_content_val;
pairedIsSet = true; // "Set" even if it's to ""
}
// Apply pairing rules: if one is effectively set (could be to ""), the other must also be set (defaulting to "" if not already).
if (unpairedIsSet && !pairedIsSet) { // This case implies pairedMsaPath was empty and pairedMsaContent was empty
currentEntity[type].pairedMsa = ""; // This line is technically redundant if pairedMsaContent was already ""
} else if (pairedIsSet && !unpairedIsSet) { // unpairedMsaPath was empty and unpairedMsaContent was empty
currentEntity[type].unpairedMsa = ""; // Redundant if unpairedMsaContent was ""
}
// Correction: if one side (e.g. unpaired) is set (to path or content including ""),
// and the other side (e.g. paired) has NO input (no path, content is empty string from blank field),
// then the "no input" side should become "".
if ( (currentEntity[type].hasOwnProperty('unpairedMsa') || currentEntity[type].hasOwnProperty('unpairedMsaPath')) &&
!(currentEntity[type].hasOwnProperty('pairedMsa') || currentEntity[type].hasOwnProperty('pairedMsaPath')) ) {
currentEntity[type].pairedMsa = "";
}
if ( (currentEntity[type].hasOwnProperty('pairedMsa') || currentEntity[type].hasOwnProperty('pairedMsaPath')) &&
!(currentEntity[type].hasOwnProperty('unpairedMsa') || currentEntity[type].hasOwnProperty('unpairedMsaPath')) ) {
currentEntity[type].unpairedMsa = "";
}
}
} else if (type === 'rna') {
delete currentEntity[type].unpairedMsa; delete currentEntity[type].unpairedMsaPath;
const rnaUnpairedMsaPathVal = seqDiv.querySelector(`input[name="seq_unpairedMsaPath_${entityId}"]`).value.trim();
const rnaUnpairedMsaContentVal = seqDiv.querySelector(`textarea[name="seq_unpairedMsa_${entityId}"]`).value; // Raw
if (rnaUnpairedMsaPathVal && rnaUnpairedMsaContentVal !== "") {
throw new Error(`RNA "${currentEntity[type].id}": Unpaired MSA content and path are mutually exclusive.`);
}
if (rnaUnpairedMsaPathVal) {
currentEntity[type].unpairedMsaPath = rnaUnpairedMsaPathVal;
} else if (rnaUnpairedMsaContentVal !== "") { // User typed content
currentEntity[type].unpairedMsa = rnaUnpairedMsaContentVal;
} else if (rnaUnpairedMsaContentVal === "") { // User explicitly wants "" (MSA-free) or left blank
currentEntity[type].unpairedMsa = ""; // Per doc: "" means MSA-free. If unset (omitted), AF3 won't build. Blank field implies "" here.
}
// If both path and content are blank strings, then the field is omitted (AF3 won't build).
if (!rnaUnpairedMsaPathVal && rnaUnpairedMsaContentVal === "") {
// If it was truly blank and not set to "" by above, ensure it's omitted
// However, the current path sets it to "" if content is "".
// For RNA: unset = no MSA. "" = MSA-free.
// If user leaves both blank, it should be unset.
if (currentEntity[type].unpairedMsa === "" && !rnaUnpairedMsaPathVal && seqDiv.querySelector(`textarea[name="seq_unpairedMsa_${entityId}"]`).value === "") {
// If the source was a truly blank textarea and no path, omit.
delete currentEntity[type].unpairedMsa;
}
}
}
if (type === 'protein') {
const templateEntries = seqDiv.querySelectorAll('.template-entry');
if (templateEntries.length > 0) {
const templates = [];
templateEntries.forEach(tplDiv => {
const mmcifContent = tplDiv.querySelector(`textarea[name^="tpl_mmcif_${entityId}"]`).value.trim();
const mmcifPath = tplDiv.querySelector(`input[name^="tpl_mmcifPath_${entityId}"]`).value.trim();
const queryIndicesRaw = tplDiv.querySelector(`input[name^="tpl_queryIndices_${entityId}"]`).value.trim();
const templateIndicesRaw = tplDiv.querySelector(`input[name^="tpl_templateIndices_${entityId}"]`).value.trim();
if (!queryIndicesRaw || !templateIndicesRaw) throw new Error(`Query and Template Indices are required for any template in protein "${currentEntity[type].id}".`);
if (!mmcifContent && !mmcifPath) throw new Error(`mmCIF content or path is required for any template in protein "${currentEntity[type].id}".`);
if (mmcifContent && mmcifPath) throw new Error(`For template in protein "${currentEntity[type].id}", provide mmCIF content OR path, not both.`);
const tpl = {};
if (mmcifPath) tpl.mmcifPath = mmcifPath;
else if (mmcifContent) tpl.mmcif = mmcifContent;
tpl.queryIndices = queryIndicesRaw.split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
tpl.templateIndices = templateIndicesRaw.split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
if (tpl.queryIndices.length === 0 || tpl.queryIndices.length !== tpl.templateIndices.length) {
throw new Error(`Mismatch or empty indices for template in protein "${currentEntity[type].id}".`);
}
templates.push(tpl);
});
currentEntity[type].templates = templates;
}
}
if (type === 'ligand') {
const ccdCodesRaw = seqDiv.querySelector(`input[name="seq_ccdCodes_${entityId}"]`).value.trim();
const smilesRaw = seqDiv.querySelector(`input[name="seq_smiles_${entityId}"]`).value.trim();
if (ccdCodesRaw && smilesRaw) throw new Error(`For ligand "${currentEntity[type].id}", specify CCD codes OR SMILES, not both.`);
if (!ccdCodesRaw && !smilesRaw) throw new Error(`For ligand "${currentEntity[type].id}", specify CCD codes or SMILES.`);
if (ccdCodesRaw) currentEntity[type].ccdCodes = ccdCodesRaw.split(',').map(s => s.trim()).filter(Boolean);
if (smilesRaw) currentEntity[type].smiles = smilesRaw;
}
output.sequences.push(currentEntity);
});
output.crosslinks = [];
document.querySelectorAll('.crosslink-group-entry').forEach(groupDiv => {
const groupIdSuffix = groupDiv.dataset.groupIdSuffix;
const groupName = groupDiv.querySelector(`input[name="cl_group_name_${groupIdSuffix}"]`).value.trim();
if (!groupName) throw new Error("Crosslink group name is required.");
const currentGroup = { name: groupName, residue_pairs: [] };
groupDiv.querySelectorAll('.crosslink-residue-pair-entry').forEach(pairDiv => {
const chainA_id = pairDiv.querySelector(`input[name^="cl_${groupIdSuffix}_pair_"][name$="_chainA_id"]`).value.trim();
const resA_idx_raw = pairDiv.querySelector(`input[name^="cl_${groupIdSuffix}_pair_"][name$="_resA_idx"]`).value.trim();
const chainB_id = pairDiv.querySelector(`input[name^="cl_${groupIdSuffix}_pair_"][name$="_chainB_id"]`).value.trim();
const resB_idx_raw = pairDiv.querySelector(`input[name^="cl_${groupIdSuffix}_pair_"][name$="_resB_idx"]`).value.trim();
if (!chainA_id || resA_idx_raw === "" || !chainB_id || resB_idx_raw === "") {
throw new Error(`Incomplete residue pair in crosslink group "${groupName}". All fields required.`);
}
const resA_idx = parseInt(resA_idx_raw);
const resB_idx = parseInt(resB_idx_raw);
if (isNaN(resA_idx) || isNaN(resB_idx)) {
throw new Error(`Residue indices must be numbers in crosslink group "${groupName}".`);
}
currentGroup.residue_pairs.push([ [chainA_id, resA_idx], [chainB_id, resB_idx] ]);
});
if (currentGroup.residue_pairs.length === 0) {
throw new Error(`Crosslink group "${groupName}" must have at least one residue pair.`);
}
output.crosslinks.push(currentGroup);
});
if (output.crosslinks.length === 0) {
delete output.crosslinks;
}
const bonds = [];
document.querySelectorAll('.bond-entry').forEach(bondDiv => {
const bondIdSuffix = bondDiv.dataset.bondIdSuffix;
const srcEntity = bondDiv.querySelector(`input[name="bond_src_entity_${bondIdSuffix}"]`).value.trim();
const srcRes = bondDiv.querySelector(`input[name="bond_src_res_${bondIdSuffix}"]`).value.trim();
const srcAtom = bondDiv.querySelector(`input[name="bond_src_atom_${bondIdSuffix}"]`).value.trim();
const destEntity = bondDiv.querySelector(`input[name="bond_dest_entity_${bondIdSuffix}"]`).value.trim();
const destRes = bondDiv.querySelector(`input[name="bond_dest_res_${bondIdSuffix}"]`).value.trim();
const destAtom = bondDiv.querySelector(`input[name="bond_dest_atom_${bondIdSuffix}"]`).value.trim();
if (!srcEntity || !srcRes || !srcAtom || !destEntity || !destRes || !destAtom) {
throw new Error("All fields are required for a bonded atom pair.");
}
bonds.push([
[srcEntity, parseInt(srcRes), srcAtom],
[destEntity, parseInt(destRes), destAtom]
]);
});
if (bonds.length > 0) output.bondedAtomPairs = bonds;
const userCCDContent = document.getElementById('userCCD').value;
const userCCDPath = document.getElementById('userCCDPath').value.trim();
if (userCCDContent && userCCDPath) throw new Error("User CCD: Provide either inline content OR a path, not both.");
if (userCCDContent) output.userCCD = userCCDContent;
if (userCCDPath) output.userCCDPath = userCCDPath;
const jsonString = JSON.stringify(output, null, 2);
jsonOutputEl.textContent = jsonString;
copyJsonBtn.style.display = 'inline-block';
downloadJsonLink.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(jsonString);
downloadJsonLink.style.display = 'inline-block';
alert("JSON generated successfully!");
} catch (error) {
alert("Error generating JSON: " + error.message);
console.error(error);
jsonOutputEl.textContent = "Error: " + error.message;
copyJsonBtn.style.display = 'none';
downloadJsonLink.style.display = 'none';
}
});
copyJsonBtn.addEventListener('click', () => {
if (jsonOutputEl.textContent) {
navigator.clipboard.writeText(jsonOutputEl.textContent)
.then(() => alert('JSON copied to clipboard!'))
.catch(err => alert('Failed to copy JSON: ' + err));
}
});
addSequenceBtn.click();
});
</script>
</body>
</html>

View File

@@ -379,6 +379,7 @@ class AlphaFold3Backend(FoldingBackend):
random_seed: int,
af3_input_json: list = None,
features_directory: str = None,
debug_templates: bool | None = None,
) -> list:
"""Prepare input for AlphaFold3 prediction."""
logging.info(f"prepare_input called with {len(objects_to_model)} objects to model")
@@ -427,6 +428,44 @@ class AlphaFold3Backend(FoldingBackend):
lines[insert_index:insert_index] = revision_lines
return '\n'.join(lines)
def strip_entity_poly_seq_block(mmcif_string: str) -> str:
"""Remove _entity_poly_seq loop to let AF3 reconstruct scheme from _atom_site.
AF3's parser can infer _pdbx_poly_seq_scheme directly from _atom_site and
avoids mismatches when our synthetic _entity_poly_seq has UNK entries.
"""
lines = mmcif_string.splitlines()
out_lines = []
i = 0
while i < len(lines):
line = lines[i]
if line.strip() == 'loop_':
# Peek ahead to see if this loop is for _entity_poly_seq
j = i + 1
is_entity_poly_seq = False
while j < len(lines) and lines[j].strip().startswith('_'):
if lines[j].strip().startswith('_entity_poly_seq.'):
is_entity_poly_seq = True
# Stop header scan when we reach first data row (no leading underscore)
j += 1
if j < len(lines) and not lines[j].strip().startswith('_'):
break
if is_entity_poly_seq:
# Skip until next blank line or next loop_/category header
k = j
while k < len(lines):
if lines[k].strip() == '' or lines[k].strip() == '#':
k += 1
break
if lines[k].strip() == 'loop_':
break
k += 1
i = k
continue
out_lines.append(line)
i += 1
return '\n'.join(out_lines)
def msa_array_to_a3m(msa_array):
msa_sequences = []
for i, msa_seq in enumerate(msa_array):
@@ -482,7 +521,35 @@ class AlphaFold3Backend(FoldingBackend):
prot=protein, file_id=pdb_code, model_type='Monomer'
)
new_mmcif_string = insert_release_date_into_mmcif(mmcif_string)
query_to_template_map = {j: j for j in range(len(template_sequence))}
# Remove _entity_poly_seq to avoid mismatches during AF3 parsing
new_mmcif_string = strip_entity_poly_seq_block(new_mmcif_string)
# Optional debug dump of generated template mmCIF
if debug_templates:
try:
os.makedirs("templates_debug", exist_ok=True)
debug_fname = os.path.join(
"templates_debug",
f"generated_template_{pdb_code}_{chain_id_template}_chain{chain_id}_idx{i}.cif",
)
with open(debug_fname, "w") as f_dbg:
f_dbg.write(new_mmcif_string)
except Exception:
# Best-effort debug; ignore failures
pass
# Build query->template mapping only for residues that have any atoms
# present in the template (avoid gaps causing index errors downstream).
try:
per_res_atom_mask = feature_dict["template_all_atom_masks"][i]
# Boolean mask: True if any atom present for this residue
present_res_mask = np.any(per_res_atom_mask > 0, axis=-1)
# Map compact template indices (0..N_present-1) to original residue indices
residue_indices_present = [idx for idx, present in enumerate(present_res_mask) if present]
compact_index_by_residue = {res_idx: compact_idx for compact_idx, res_idx in enumerate(residue_indices_present)}
# Query indices are positions in the template sequence aligned to the query
query_to_template_map = {res_idx: compact_index_by_residue[res_idx] for res_idx in residue_indices_present}
except Exception:
# Fallback to identity if masks missing, though this may error later
query_to_template_map = {j: j for j in range(len(template_sequence))}
templates.append(
folding_input.Template(
mmcif=new_mmcif_string,
@@ -690,6 +757,7 @@ class AlphaFold3Backend(FoldingBackend):
random_seed=random_seed,
af3_input_json=kwargs.get("af3_input_json"),
features_directory=kwargs.get("features_directory"),
debug_templates=kwargs.get("debug_templates", False),
)
# Run predictions

View File

@@ -170,6 +170,10 @@ flags.DEFINE_boolean('use_gpu_relax', True,
flags.DEFINE_string('protein_delimiter', '+', 'Delimiter for proteins of a single fold.')
flags.DEFINE_string('fold_backend', 'alphafold',
'Folding backend that should be used for structure prediction.')
flags.DEFINE_boolean(
'debug_templates', False,
'If set, save generated template mmCIFs to templates_debug/ during AF3 input prep.'
)
FLAGS = flags.FLAGS
@@ -350,6 +354,7 @@ def main(argv):
"jax_compilation_cache_dir": FLAGS.jax_compilation_cache_dir,
"features_directory": FLAGS.features_directory,
"num_seeds": FLAGS.num_seeds,
"debug_templates": FLAGS.debug_templates,
}
# Override model name for AlphaLink backend

370
compare_msas.ipynb Normal file
View File

@@ -0,0 +1,370 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"id": "801c8b9f-086a-40f8-8699-e3ed9f7e6859",
"metadata": {},
"outputs": [],
"source": [
"from Bio import AlignIO\n",
"\n",
"# Load both MSAs\n",
"msa1 = AlignIO.read(\"ap_msa_with_pairing.sto\", \"stockholm\")\n",
"msa2 = AlignIO.read(\"af_msa.sto\", \"stockholm\")\n",
"\n",
"# Build ID → sequence dicts\n",
"seqs1 = {record.id: str(record.seq) for record in msa1}\n",
"seqs2 = {record.id: str(record.seq) for record in msa2}\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "04db58eb-4704-434f-a230-4162c96d0f8e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"seq_34 <--> seq_35\n",
"seq_35 <--> seq_34\n",
"seq_143 <--> seq_144\n",
"seq_144 not found in af_msa\n",
"seq_149 <--> seq_150\n",
"seq_150 <--> seq_151\n",
"seq_151 <--> seq_152\n",
"seq_152 <--> seq_153\n",
"seq_153 <--> seq_154\n",
"seq_154 <--> seq_155\n",
"seq_155 <--> seq_156\n",
"seq_156 <--> seq_157\n",
"seq_157 <--> seq_158\n",
"seq_158 <--> seq_159\n",
"seq_159 not found in af_msa\n",
"seq_166 not found in af_msa\n",
"seq_167 <--> seq_166\n",
"seq_168 <--> seq_167\n",
"seq_169 <--> seq_168\n",
"seq_178 not found in af_msa\n",
"seq_179 <--> seq_178\n",
"seq_180 <--> seq_179\n",
"seq_181 <--> seq_180\n",
"seq_182 not found in af_msa\n",
"seq_183 <--> seq_181\n",
"seq_184 <--> seq_182\n",
"seq_185 <--> seq_183\n",
"seq_186 <--> seq_184\n",
"seq_187 <--> seq_185\n",
"seq_188 <--> seq_186\n",
"seq_189 <--> seq_187\n",
"seq_190 <--> seq_188\n",
"seq_191 <--> seq_189\n",
"seq_192 <--> seq_190\n",
"seq_193 <--> seq_191\n",
"seq_194 <--> seq_193\n",
"seq_195 <--> seq_194\n",
"seq_196 <--> seq_195\n",
"seq_198 <--> seq_199\n",
"seq_199 not found in af_msa\n",
"seq_219 <--> seq_220\n",
"seq_220 <--> seq_221\n",
"seq_221 <--> seq_222\n",
"seq_222 not found in af_msa\n",
"seq_227 not found in af_msa\n",
"seq_228 <--> seq_227\n",
"seq_229 <--> seq_228\n",
"seq_230 <--> seq_229\n",
"seq_231 <--> seq_230\n",
"seq_232 <--> seq_231\n",
"seq_233 <--> seq_232\n",
"seq_236 <--> seq_237\n",
"seq_237 <--> seq_238\n",
"seq_238 <--> seq_239\n",
"seq_239 <--> seq_240\n",
"seq_240 <--> seq_241\n",
"seq_241 <--> seq_242\n",
"seq_242 <--> seq_243\n",
"seq_243 not found in af_msa\n",
"seq_254 not found in af_msa\n",
"seq_255 <--> seq_254\n",
"seq_256 <--> seq_255\n",
"seq_257 <--> seq_256\n",
"seq_258 <--> seq_257\n",
"seq_263 <--> seq_264\n",
"seq_264 <--> seq_265\n",
"seq_265 <--> seq_266\n",
"seq_266 <--> seq_267\n",
"seq_267 <--> seq_268\n",
"seq_268 <--> seq_269\n",
"seq_269 not found in af_msa\n",
"seq_272 not found in af_msa\n",
"seq_273 <--> seq_272\n",
"seq_274 <--> seq_273\n",
"seq_275 <--> seq_274\n",
"seq_276 <--> seq_275\n",
"seq_281 <--> seq_282\n",
"seq_282 <--> seq_283\n",
"seq_283 <--> seq_284\n",
"seq_284 <--> seq_285\n",
"seq_285 <--> seq_286\n",
"seq_286 <--> seq_287\n",
"seq_287 <--> seq_288\n",
"seq_288 <--> seq_289\n",
"seq_289 <--> seq_290\n",
"seq_290 <--> seq_291\n",
"seq_291 <--> seq_292\n",
"seq_292 <--> seq_293\n",
"seq_293 <--> seq_294\n",
"seq_294 <--> seq_295\n",
"seq_295 <--> seq_296\n",
"seq_296 <--> seq_297\n",
"seq_297 <--> seq_298\n",
"seq_298 <--> seq_299\n",
"seq_299 not found in af_msa\n",
"seq_300 <--> seq_301\n",
"seq_301 <--> seq_302\n",
"seq_302 <--> seq_303\n",
"seq_303 <--> seq_304\n",
"seq_304 not found in af_msa\n",
"seq_307 not found in af_msa\n",
"seq_308 <--> seq_307\n",
"seq_309 <--> seq_308\n",
"seq_310 <--> seq_309\n",
"seq_311 <--> seq_310\n",
"seq_312 <--> seq_311\n",
"seq_313 <--> seq_312\n",
"seq_314 <--> seq_313\n",
"seq_315 <--> seq_314\n",
"seq_316 <--> seq_315\n",
"seq_317 <--> seq_316\n",
"seq_318 <--> seq_317\n",
"seq_319 <--> seq_318\n",
"seq_320 <--> seq_319\n",
"seq_321 <--> seq_320\n",
"seq_322 <--> seq_321\n",
"seq_323 <--> seq_322\n",
"seq_324 <--> seq_323\n",
"seq_325 <--> seq_324\n",
"seq_326 <--> seq_325\n",
"seq_327 <--> seq_326\n",
"seq_328 <--> seq_327\n",
"seq_329 <--> seq_328\n",
"seq_330 <--> seq_329\n",
"seq_331 <--> seq_330\n",
"seq_332 <--> seq_331\n",
"seq_333 <--> seq_332\n",
"seq_334 <--> seq_333\n",
"seq_335 not found in af_msa\n",
"seq_336 <--> seq_335\n",
"seq_337 <--> seq_336\n",
"seq_338 <--> seq_337\n",
"seq_339 <--> seq_338\n",
"seq_340 <--> seq_339\n",
"seq_341 <--> seq_340\n",
"seq_342 <--> seq_341\n",
"seq_343 <--> seq_342\n",
"seq_344 <--> seq_343\n",
"seq_345 <--> seq_344\n",
"seq_346 <--> seq_345\n",
"seq_347 <--> seq_346\n",
"seq_348 <--> seq_347\n",
"seq_349 <--> seq_348\n",
"seq_350 <--> seq_349\n",
"seq_351 <--> seq_350\n",
"seq_352 <--> seq_351\n",
"seq_353 <--> seq_352\n",
"seq_362 <--> seq_363\n",
"seq_363 <--> seq_364\n",
"seq_364 <--> seq_365\n",
"seq_365 <--> seq_366\n",
"seq_366 <--> seq_367\n",
"seq_367 <--> seq_368\n",
"seq_368 not found in af_msa\n",
"seq_370 not found in af_msa\n",
"seq_371 <--> seq_370\n",
"seq_372 <--> seq_371\n",
"seq_373 <--> seq_372\n",
"seq_374 <--> seq_373\n",
"seq_375 <--> seq_374\n",
"seq_376 <--> seq_375\n",
"seq_377 <--> seq_376\n",
"seq_378 <--> seq_377\n",
"seq_379 <--> seq_378\n",
"seq_380 <--> seq_379\n",
"seq_381 <--> seq_380\n",
"seq_382 <--> seq_381\n",
"seq_383 <--> seq_382\n",
"seq_384 <--> seq_383\n",
"seq_385 <--> seq_384\n",
"seq_386 <--> seq_385\n",
"seq_387 <--> seq_386\n",
"seq_389 <--> seq_390\n",
"seq_390 <--> seq_391\n",
"seq_391 <--> seq_392\n",
"seq_392 <--> seq_393\n",
"seq_393 <--> seq_394\n",
"seq_394 <--> seq_395\n",
"seq_395 <--> seq_396\n",
"seq_396 <--> seq_397\n",
"seq_397 <--> seq_398\n",
"seq_398 <--> seq_399\n",
"seq_399 <--> seq_400\n",
"seq_400 <--> seq_401\n",
"seq_401 <--> seq_402\n",
"seq_402 <--> seq_403\n",
"seq_403 <--> seq_404\n",
"seq_404 <--> seq_405\n",
"seq_405 <--> seq_406\n",
"seq_406 <--> seq_408\n",
"seq_407 <--> seq_409\n",
"seq_408 <--> seq_410\n",
"seq_409 <--> seq_411\n",
"seq_410 <--> seq_412\n",
"seq_411 not found in af_msa\n",
"seq_412 <--> seq_413\n",
"seq_413 <--> seq_414\n",
"seq_414 <--> seq_415\n",
"seq_415 <--> seq_416\n",
"seq_416 <--> seq_417\n",
"seq_417 <--> seq_418\n",
"seq_418 <--> seq_419\n",
"seq_419 <--> seq_420\n",
"seq_420 <--> seq_421\n",
"seq_421 <--> seq_422\n",
"seq_422 <--> seq_423\n",
"seq_423 <--> seq_424\n",
"seq_424 <--> seq_425\n",
"seq_425 <--> seq_426\n",
"seq_426 <--> seq_427\n",
"seq_427 <--> seq_428\n",
"seq_428 <--> seq_429\n",
"seq_429 <--> seq_430\n",
"seq_430 <--> seq_431\n",
"seq_431 <--> seq_432\n",
"seq_432 <--> seq_433\n",
"seq_433 <--> seq_434\n",
"seq_434 <--> seq_435\n",
"seq_435 <--> seq_436\n",
"seq_436 <--> seq_437\n",
"seq_437 not found in af_msa\n",
"seq_455 <--> seq_456\n",
"seq_456 <--> seq_457\n",
"seq_457 <--> seq_458\n",
"seq_458 <--> seq_459\n",
"seq_459 not found in af_msa\n",
"seq_461 <--> seq_462\n",
"seq_462 <--> seq_463\n",
"seq_463 <--> seq_464\n",
"seq_464 not found in af_msa\n",
"seq_471 not found in af_msa\n",
"seq_472 <--> seq_471\n",
"seq_473 <--> seq_472\n",
"seq_474 <--> seq_473\n",
"seq_475 <--> seq_474\n",
"seq_476 <--> seq_475\n",
"seq_477 <--> seq_476\n",
"seq_478 <--> seq_477\n",
"seq_479 <--> seq_478\n",
"seq_480 <--> seq_479\n",
"seq_481 <--> seq_480\n",
"seq_482 <--> seq_481\n",
"seq_483 <--> seq_482\n",
"seq_500 not found in af_msa\n",
"seq_501 <--> seq_500\n",
"seq_502 <--> seq_501\n",
"seq_503 not found in af_msa\n",
"seq_504 <--> seq_503\n",
"seq_505 <--> seq_504\n",
"seq_506 <--> seq_505\n",
"seq_507 <--> seq_506\n",
"seq_508 <--> seq_507\n",
"seq_509 <--> seq_508\n",
"seq_510 not found in af_msa\n",
"seq_511 <--> seq_509\n",
"seq_512 <--> seq_510\n",
"seq_513 <--> seq_511\n",
"seq_514 <--> seq_513\n",
"seq_515 <--> seq_514\n",
"seq_516 <--> seq_515\n",
"seq_517 <--> seq_516\n",
"seq_518 <--> seq_517\n",
"seq_519 <--> seq_518\n",
"seq_520 <--> seq_519\n",
"seq_521 <--> seq_520\n",
"seq_522 <--> seq_521\n",
"seq_523 <--> seq_522\n",
"seq_524 <--> seq_523\n",
"seq_525 not found in af_msa\n",
"seq_585 <--> seq_586\n",
"seq_586 not found in af_msa\n",
"28 unique sequences in AP compared to AF\n",
"243 sequences are swapped in AP compared to AF\n"
]
}
],
"source": [
"from Bio import AlignIO\n",
"\n",
"# Read the two MSAs\n",
"msa_ap = AlignIO.read(\"ap_msa_with_pairing.sto\", \"stockholm\")\n",
"msa_af = AlignIO.read(\"af_msa.sto\", \"stockholm\")\n",
"\n",
"# Build dicts for each\n",
"seqs_ap = {record.id: str(record.seq) for record in msa_ap}\n",
"seqs_af = {record.id: str(record.seq) for record in msa_af}\n",
"\n",
"# Build reverse lookup for the af MSA: sequence → ID\n",
"rev_af = {seq: rec_id for rec_id, seq in seqs_af.items()}\n",
"\n",
"# Compare\n",
"not_found = 0\n",
"swapped = 0\n",
"for ap_id, ap_seq in seqs_ap.items():\n",
" af_id = rev_af.get(ap_seq)\n",
" if af_id is None:\n",
" # In case no match is found (shouldn't happen if the sequences truly match)\n",
" print(f\"{ap_id} not found in af_msa\")\n",
" not_found += 1\n",
" else:\n",
" # If IDs differ, they're swapped\n",
" if ap_id != af_id:\n",
" print(f\"{ap_id} <--> {af_id}\")\n",
" swapped += 1\n",
"print(f\"{not_found} unique sequences in AP compared to AF\")\n",
"print(f\"{swapped} sequences are swapped in AP compared to AF\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "44b116f4-718b-4c15-975e-80d2de363354",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

2
conda/.condarc Normal file
View File

@@ -0,0 +1,2 @@
channels:
- conda-forge

0
conda/.nonadmin Normal file
View File

46
conda/LICENSE.txt Normal file
View File

@@ -0,0 +1,46 @@
Miniforge installer code uses BSD-3-Clause license as stated below.
Binary packages that come with it have their own licensing terms
and by installing miniforge you agree to the licensing terms of individual
packages as well. They include different OSI-approved licenses including
the GNU General Public License and can be found in pkgs/<pkg-name>/info/licenses
folders.
Miniforge installer comes with a bootstrapping executable that is used
when installing miniforge and is deleted after miniforge is installed.
The bootstrapping executable uses micromamba, cli11, cpp-filesystem,
curl, c-ares, krb5, libarchive, libev, lz4, nghttp2, openssl, libsolv,
nlohmann-json, reproc and zstd which are licensed under BSD-3-Clause,
MIT and OpenSSL licenses. Licenses and copyright notices of these
projects can be found at the following URL.
https://github.com/conda-forge/micromamba-feedstock/tree/master/recipe.
=============================================================================
Copyright (c) 2019-2022, conda-forge
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

BIN
conda/_conda Executable file

Binary file not shown.

1
conda/bin/2to3 Symbolic link
View File

@@ -0,0 +1 @@
2to3-3.12

5
conda/bin/2to3-3.12 Executable file
View File

@@ -0,0 +1,5 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
import sys
from lib2to3.main import main
sys.exit(main("lib2to3.fixes"))

6
conda/bin/activate Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
_CONDA_ROOT="/home/dmolodenskiy/AlphaPulldown/conda"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
conda activate "$@"

BIN
conda/bin/adig Executable file

Binary file not shown.

BIN
conda/bin/ahost Executable file

Binary file not shown.

10
conda/bin/archspec Executable file
View File

@@ -0,0 +1,10 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from archspec.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

BIN
conda/bin/bsdcat Executable file

Binary file not shown.

BIN
conda/bin/bsdcpio Executable file

Binary file not shown.

BIN
conda/bin/bsdtar Executable file

Binary file not shown.

BIN
conda/bin/bsdunzip Executable file

Binary file not shown.

BIN
conda/bin/bunzip2 Executable file

Binary file not shown.

BIN
conda/bin/bzcat Executable file

Binary file not shown.

1
conda/bin/bzcmp Symbolic link
View File

@@ -0,0 +1 @@
bzdiff

76
conda/bin/bzdiff Executable file
View File

@@ -0,0 +1,76 @@
#!/bin/sh
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
# Bzcmp/diff wrapped for bzip2,
# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
# gram on compressed files. All options specified are passed
# directly to cmp or diff. If only 1 file is specified, then
# the files compared are file1 and an uncompressed file1.gz.
# If two files are specified, then they are uncompressed (if
# necessary) and fed to cmp or diff. The exit status from cmp
# or diff is preserved.
PATH="/usr/bin:/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*cmp) comp=${CMP-cmp} ;;
*) comp=${DIFF-diff} ;;
esac
OPTIONS=
FILES=
for ARG
do
case "$ARG" in
-*) OPTIONS="$OPTIONS $ARG";;
*) if test -f "$ARG"; then
FILES="$FILES $ARG"
else
echo "${prog}: $ARG not found or not a regular file"
exit 1
fi ;;
esac
done
if test -z "$FILES"; then
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
set $FILES
if test $# -eq 1; then
FILE=`echo "$1" | sed 's/.bz2$//'`
bzip2 -cd "$FILE.bz2" | $comp $OPTIONS - "$FILE"
STAT="$?"
elif test $# -eq 2; then
case "$1" in
*.bz2)
case "$2" in
*.bz2)
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || {
echo 'cannot create a temporary file' >&2
exit 1
}
bzip2 -cdfq "$2" > "$tmp"
bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp"
STAT="$?"
/bin/rm -f "$tmp";;
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
esac;;
*) case "$2" in
*.bz2)
bzip2 -cdfq "$2" | $comp $OPTIONS "$1" -
STAT="$?";;
*) $comp $OPTIONS "$1" "$2"
STAT="$?";;
esac;;
esac
else
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
exit "$STAT"

1
conda/bin/bzegrep Symbolic link
View File

@@ -0,0 +1 @@
bzgrep

1
conda/bin/bzfgrep Symbolic link
View File

@@ -0,0 +1 @@
bzgrep

85
conda/bin/bzgrep Executable file
View File

@@ -0,0 +1,85 @@
#!/bin/sh
# Bzgrep wrapped for bzip2,
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
## zgrep notice:
## zgrep -- a wrapper around a grep program that decompresses files as needed
## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*egrep) grep=${EGREP-egrep} ;;
*fgrep) grep=${FGREP-fgrep} ;;
*) grep=${GREP-grep} ;;
esac
pat=""
while test $# -ne 0; do
case "$1" in
-e | -f) opt="$opt $1"; shift; pat="$1"
if test "$grep" = grep; then # grep is buggy with -e on SVR4
grep=egrep
fi;;
-A | -B) opt="$opt $1 $2"; shift;;
-*) opt="$opt $1";;
*) if test -z "$pat"; then
pat="$1"
else
break;
fi;;
esac
shift
done
if test -z "$pat"; then
echo "grep through bzip2 files"
echo "usage: $prog [grep_options] pattern [files]"
exit 1
fi
list=0
silent=0
op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$op" in
*l*) list=1
esac
case "$op" in
*h*) silent=1
esac
if test $# -eq 0; then
bzip2 -cdfq | $grep $opt "$pat"
exit $?
fi
res=0
for i do
if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
if test $list -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
r=$?
elif test $# -eq 1 -o $silent -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
j=$(echo "$i" | sed 's/\\/&&/g;s/|/\\&/g;s/&/\\&/g')
j=`printf "%s" "$j" | tr '\n' ' '`
# A trick adapted from
# https://groups.google.com/forum/#!original/comp.unix.shell/x1345iu10eg/Nn1n-1r1uU0J
# that has the same effect as the following bash code:
# bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
# r=${PIPESTATUS[1]}
exec 3>&1
eval `
exec 4>&1 >&3 3>&-
{
bzip2 -cdfq "$i" 4>&-
} | {
$grep $opt "$pat" 4>&-; echo "r=$?;" >&4
} | sed "s|^|${j}:|"
`
fi
test "$r" -ne 0 && res="$r"
done
exit $res

BIN
conda/bin/bzip2 Executable file

Binary file not shown.

BIN
conda/bin/bzip2recover Executable file

Binary file not shown.

1
conda/bin/bzless Symbolic link
View File

@@ -0,0 +1 @@
bzmore

61
conda/bin/bzmore Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/sh
# Bzmore wrapped for bzip2,
# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*less) more=less ;;
*) more=more ;;
esac
if test "`echo -n a`" = "-n a"; then
# looks like a SysV system:
n1=''; n2='\c'
else
n1='-n'; n2=''
fi
oldtty=`stty -g 2>/dev/null`
if stty -cbreak 2>/dev/null; then
cb='cbreak'; ncb='-cbreak'
else
# 'stty min 1' resets eof to ^a on both SunOS and SysV!
cb='min 1 -icanon'; ncb='icanon eof ^d'
fi
if test $? -eq 0 -a -n "$oldtty"; then
trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
else
trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
fi
if test $# = 0; then
if test -t 0; then
echo usage: $prog files...
else
bzip2 -cdfq | eval $more
fi
else
FIRST=1
for FILE
do
if test $FIRST -eq 0; then
echo $n1 "--More--(Next file: $FILE)$n2"
stty $cb -echo 2>/dev/null
ANS=`dd bs=1 count=1 2>/dev/null`
stty $ncb echo 2>/dev/null
echo " "
if test "$ANS" = 'e' -o "$ANS" = 'q'; then
exit
fi
fi
if test "$ANS" != 's'; then
echo "------> $FILE <------"
bzip2 -cdfq "$FILE" | eval $more
fi
if test -t; then
FIRST=0
fi
done
fi

252
conda/bin/c_rehash Executable file
View File

@@ -0,0 +1,252 @@
#!/usr/bin/env perl
# WARNING: do not edit!
# Generated by Makefile from tools/c_rehash.in
# Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
# Perl c_rehash script, scan all files in a directory
# and add symbolic links to their hash values.
my $dir = "";
my $prefix = "/home/dmolodenskiy/AlphaPulldown/conda";
my $errorcount = 0;
my $openssl = $ENV{OPENSSL} || "openssl";
my $pwd;
my $x509hash = "-subject_hash";
my $crlhash = "-hash";
my $verbose = 0;
my $symlink_exists=eval {symlink("",""); 1};
my $removelinks = 1;
## Parse flags.
while ( $ARGV[0] =~ /^-/ ) {
my $flag = shift @ARGV;
last if ( $flag eq '--');
if ( $flag eq '-old') {
$x509hash = "-subject_hash_old";
$crlhash = "-hash_old";
} elsif ( $flag eq '-h' || $flag eq '-help' ) {
help();
} elsif ( $flag eq '-n' ) {
$removelinks = 0;
} elsif ( $flag eq '-v' ) {
$verbose++;
}
else {
print STDERR "Usage error; try -h.\n";
exit 1;
}
}
sub help {
print "Usage: c_rehash [-old] [-h] [-help] [-v] [dirs...]\n";
print " -old use old-style digest\n";
print " -h or -help print this help text\n";
print " -v print files removed and linked\n";
exit 0;
}
eval "require Cwd";
if (defined(&Cwd::getcwd)) {
$pwd=Cwd::getcwd();
} else {
$pwd=`pwd`;
chomp($pwd);
}
# DOS/Win32 or Unix delimiter? Prefix our installdir, then search.
my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':';
$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");
if (! -x $openssl) {
my $found = 0;
foreach (split /$path_delim/, $ENV{PATH}) {
if (-x "$_/$openssl") {
$found = 1;
$openssl = "$_/$openssl";
last;
}
}
if ($found == 0) {
print STDERR "c_rehash: rehashing skipped ('openssl' program not available)\n";
exit 0;
}
}
if (@ARGV) {
@dirlist = @ARGV;
} elsif ($ENV{SSL_CERT_DIR}) {
@dirlist = split /$path_delim/, $ENV{SSL_CERT_DIR};
} else {
$dirlist[0] = "$dir/certs";
}
if (-d $dirlist[0]) {
chdir $dirlist[0];
$openssl="$pwd/$openssl" if (!-x $openssl);
chdir $pwd;
}
foreach (@dirlist) {
if (-d $_ ) {
if ( -w $_) {
hash_dir($_);
} else {
print "Skipping $_, can't write\n";
$errorcount++;
}
}
}
exit($errorcount);
sub copy_file {
my ($src_fname, $dst_fname) = @_;
if (open(my $in, "<", $src_fname)) {
if (open(my $out, ">", $dst_fname)) {
print $out $_ while (<$in>);
close $out;
} else {
warn "Cannot open $dst_fname for write, $!";
}
close $in;
} else {
warn "Cannot open $src_fname for read, $!";
}
}
sub hash_dir {
my $dir = shift;
my %hashlist;
print "Doing $dir\n";
if (!chdir $dir) {
print STDERR "WARNING: Cannot chdir to '$dir', $!\n";
return;
}
opendir(DIR, ".") || print STDERR "WARNING: Cannot opendir '.', $!\n";
my @flist = sort readdir(DIR);
closedir DIR;
if ( $removelinks ) {
# Delete any existing symbolic links
foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) {
if (-l $_) {
print "unlink $_\n" if $verbose;
unlink $_ || warn "Can't unlink $_, $!\n";
}
}
}
FILE: foreach $fname (grep {/\.(pem|crt|cer|crl)$/} @flist) {
# Check to see if certificates and/or CRLs present.
my ($cert, $crl) = check_file($fname);
if (!$cert && !$crl) {
print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
next;
}
link_hash_cert($fname) if ($cert);
link_hash_crl($fname) if ($crl);
}
chdir $pwd;
}
sub check_file {
my ($is_cert, $is_crl) = (0,0);
my $fname = $_[0];
open(my $in, "<", $fname);
while(<$in>) {
if (/^-----BEGIN (.*)-----/) {
my $hdr = $1;
if ($hdr =~ /^(X509 |TRUSTED |)CERTIFICATE$/) {
$is_cert = 1;
last if ($is_crl);
} elsif ($hdr eq "X509 CRL") {
$is_crl = 1;
last if ($is_cert);
}
}
}
close $in;
return ($is_cert, $is_crl);
}
sub compute_hash {
my $fh;
if ( $^O eq "VMS" ) {
# VMS uses the open through shell
# The file names are safe there and list form is unsupported
if (!open($fh, "-|", join(' ', @_))) {
print STDERR "Cannot compute hash on '$fname'\n";
return;
}
} else {
if (!open($fh, "-|", @_)) {
print STDERR "Cannot compute hash on '$fname'\n";
return;
}
}
return (<$fh>, <$fh>);
}
# Link a certificate to its subject name hash value, each hash is of
# the form <hash>.<n> where n is an integer. If the hash value already exists
# then we need to up the value of n, unless its a duplicate in which
# case we skip the link. We check for duplicates by comparing the
# certificate fingerprints
sub link_hash_cert {
link_hash($_[0], 'cert');
}
# Same as above except for a CRL. CRL links are of the form <hash>.r<n>
sub link_hash_crl {
link_hash($_[0], 'crl');
}
sub link_hash {
my ($fname, $type) = @_;
my $is_cert = $type eq 'cert';
my ($hash, $fprint) = compute_hash($openssl,
$is_cert ? "x509" : "crl",
$is_cert ? $x509hash : $crlhash,
"-fingerprint", "-noout",
"-in", $fname);
chomp $hash;
$hash =~ s/^.*=// if !$is_cert;
chomp $fprint;
return if !$hash;
$fprint =~ s/^.*=//;
$fprint =~ tr/://d;
my $suffix = 0;
# Search for an unused hash filename
my $crlmark = $is_cert ? "" : "r";
while(exists $hashlist{"$hash.$crlmark$suffix"}) {
# Hash matches: if fingerprint matches its a duplicate cert
if ($hashlist{"$hash.$crlmark$suffix"} eq $fprint) {
my $what = $is_cert ? 'certificate' : 'CRL';
print STDERR "WARNING: Skipping duplicate $what $fname\n";
return;
}
$suffix++;
}
$hash .= ".$crlmark$suffix";
if ($symlink_exists) {
print "link $fname -> $hash\n" if $verbose;
symlink $fname, $hash || warn "Can't symlink, $!";
} else {
print "copy $fname -> $hash\n" if $verbose;
copy_file($fname, $hash);
}
$hashlist{$hash} = $fprint;
}

1
conda/bin/captoinfo Symbolic link
View File

@@ -0,0 +1 @@
tic

BIN
conda/bin/clear Executable file

Binary file not shown.

36
conda/bin/compile_et Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
#
#
AWK=gawk
DIR=/home/dmolodenskiy/AlphaPulldown/conda/share/et
usage="usage: $0 [ -d scriptDir ] [ --textdomain domain [ --localedir dir ] ]"
usage="$usage inputfile.et"
TEXTDOMAIN=
LOCALEDIR=
while [ $# -ge 2 ]; do
if [ "$1" = "-d" ]; then
DIR=$2; shift; shift
elif [ "$1" = "--textdomain" ]; then
TEXTDOMAIN=$2; shift; shift
elif [ "$1" = "--localedir" ]; then
LOCALEDIR=$2; shift; shift
else
echo $usage 1>&2 ; exit 1
fi
done
# --localedir requires --textdomain.
if [ $# -ne 1 -o \( -n "$LOCALEDIR" -a -z "$TEXTDOMAIN" \) ]; then
echo $usage 1>&2 ; exit 1
fi
ROOT=`echo $1 | sed -e s/.et$//`
BASE=`echo "$ROOT" | sed -e 's;.*/;;'`
set -ex
$AWK -f ${DIR}/et_h.awk "outfile=${BASE}.h" "$ROOT.et"
$AWK -f ${DIR}/et_c.awk "outfile=${BASE}.c" "textdomain=$TEXTDOMAIN" \
"localedir=$LOCALEDIR" "$ROOT.et"

13
conda/bin/conda Executable file
View File

@@ -0,0 +1,13 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python
# -*- coding: utf-8 -*-
import sys
# Before any more imports, leave cwd out of sys.path for internal 'conda shell.*' commands.
# see https://github.com/conda/conda/issues/6549
if len(sys.argv) > 1 and sys.argv[1].startswith('shell.') and sys.path and sys.path[0] == '':
# The standard first entry in sys.path is an empty string,
# and os.path.abspath('') expands to os.getcwd().
del sys.path[0]
if __name__ == '__main__':
from conda.cli import main
sys.exit(main())

7
conda/bin/conda-env Executable file
View File

@@ -0,0 +1,7 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
from conda_env.cli.main import main
sys.exit(main())

BIN
conda/bin/conda2solv Executable file

Binary file not shown.

10
conda/bin/cph Executable file
View File

@@ -0,0 +1,10 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from conda_package_handling.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

195
conda/bin/curl-config Executable file
View File

@@ -0,0 +1,195 @@
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# shellcheck disable=SC2006
prefix='/home/dmolodenskiy/AlphaPulldown/conda'
# Used in 'libdir'
# shellcheck disable=SC2034
exec_prefix="${prefix}"
# shellcheck disable=SC2034
includedir="${prefix}/include"
cppflag_curl_staticlib=''
usage()
{
cat <<EOF
Usage: curl-config [OPTION]
Available values for OPTION include:
--built-shared says 'yes' if libcurl was built shared
--ca CA bundle install path
--cc compiler
--cflags preprocessor and compiler flags
--checkfor [version] check for (lib)curl of the specified version
--configure the arguments given to configure when building curl
--features newline separated list of enabled features
--help display this help and exit
--libs library linking information
--prefix curl install prefix
--protocols newline separated list of enabled protocols
--ssl-backends output the SSL backends libcurl was built to support
--static-libs static libcurl library linking information
--version output version information
--vernum output version as a hexadecimal number
EOF
exit "$1"
}
if test "$#" -eq 0; then
usage 1
fi
while test "$#" -gt 0; do
case "$1" in
--built-shared)
echo 'yes'
;;
--ca)
echo '/home/dmolodenskiy/AlphaPulldown/conda/ssl/cacert.pem'
;;
--cc)
echo '/home/conda/feedstock_root/build_artifacts/curl_split_recipe_1733999596960/_build_env/bin/x86_64-conda-linux-gnu-cc'
;;
--prefix)
echo "$prefix"
;;
--feature|--features)
for feature in alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz NTLM SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd ''; do
test -n "$feature" && echo "$feature"
done
;;
--protocols)
# shellcheck disable=SC2043
for protocol in DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS IPFS IPNS MQTT POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP WS WSS; do
echo "$protocol"
done
;;
--version)
echo 'libcurl 8.11.1'
exit 0
;;
--checkfor)
checkfor="$2"
cmajor=`echo "$checkfor" | cut -d. -f1`
cminor=`echo "$checkfor" | cut -d. -f2`
# when extracting the patch part we strip off everything after a
# dash as that's used for things like version 1.2.3-pre1
cpatch=`echo "$checkfor" | cut -d. -f3 | cut -d- -f1`
vmajor=`echo '8.11.1' | cut -d. -f1`
vminor=`echo '8.11.1' | cut -d. -f2`
# when extracting the patch part we strip off everything after a
# dash as that's used for things like version 1.2.3-pre1
vpatch=`echo '8.11.1' | cut -d. -f3 | cut -d- -f1`
if test "$vmajor" -gt "$cmajor"; then
exit 0
fi
if test "$vmajor" -eq "$cmajor"; then
if test "$vminor" -gt "$cminor"; then
exit 0
fi
if test "$vminor" -eq "$cminor"; then
if test "$cpatch" -le "$vpatch"; then
exit 0
fi
fi
fi
echo "requested version $checkfor is newer than existing 8.11.1"
exit 1
;;
--vernum)
echo '080b01'
exit 0
;;
--help)
usage 0
;;
--cflags)
if test "X$cppflag_curl_staticlib" = 'X-DCURL_STATICLIB'; then
CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB '
else
CPPFLAG_CURL_STATICLIB=''
fi
if test "X${prefix}/include" = 'X/usr/include'; then
echo "${CPPFLAG_CURL_STATICLIB}"
else
echo "${CPPFLAG_CURL_STATICLIB}-I${prefix}/include"
fi
;;
--libs)
if test "X${exec_prefix}/lib" != 'X/usr/lib' -a "X${exec_prefix}/lib" != 'X/usr/lib64'; then
CURLLIBDIR="-L${exec_prefix}/lib "
else
CURLLIBDIR=''
fi
if test 'Xyes' = 'Xno'; then
echo "${CURLLIBDIR}-lcurl -lnghttp2 -lssh2 -lssh2 -lssl -lcrypto -lssl -lcrypto -L/home/dmolodenskiy/AlphaPulldown/conda/lib -lgssapi_krb5 -lzstd -lzstd -lz -pthread"
else
echo "${CURLLIBDIR}-lcurl"
fi
;;
--ssl-backends)
echo 'OpenSSL v3+'
;;
--static-libs)
if test 'Xyes' != 'Xno'; then
echo "${exec_prefix}/lib/libcurl.a -L/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib -lnghttp2 -lssh2 -lssh2 -lssl -lcrypto -lssl -lcrypto -L/home/dmolodenskiy/AlphaPulldown/conda/lib -lgssapi_krb5 -lzstd -lzstd -lz -pthread"
else
echo 'curl was built with static libraries disabled' >&2
exit 1
fi
;;
--configure)
echo " '--prefix=/home/dmolodenskiy/AlphaPulldown/conda' '--host=x86_64-conda-linux-gnu' '--disable-ldap' '--enable-websockets' '--with-ca-bundle=/home/dmolodenskiy/AlphaPulldown/conda/ssl/cacert.pem' '--with-openssl=/home/dmolodenskiy/AlphaPulldown/conda' '--with-zlib=/home/dmolodenskiy/AlphaPulldown/conda' '--with-zstd=/home/dmolodenskiy/AlphaPulldown/conda' '--with-gssapi=/home/dmolodenskiy/AlphaPulldown/conda' '--with-libssh2=/home/dmolodenskiy/AlphaPulldown/conda' '--with-nghttp2=/home/dmolodenskiy/AlphaPulldown/conda' '--without-libpsl' 'build_alias=x86_64-conda-linux-gnu' 'host_alias=x86_64-conda-linux-gnu' 'CC=/home/conda/feedstock_root/build_artifacts/curl_split_recipe_1733999596960/_build_env/bin/x86_64-conda-linux-gnu-cc' 'CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/dmolodenskiy/AlphaPulldown/conda/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/curl_split_recipe_1733999596960/work=/usr/local/src/conda/curl_split_recipe-8.11.1 -fdebug-prefix-map=/home/dmolodenskiy/AlphaPulldown/conda=/usr/local/src/conda-prefix -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/dmolodenskiy/AlphaPulldown/conda/include' 'LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/dmolodenskiy/AlphaPulldown/conda/lib -Wl,-rpath-link,/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib' 'CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/dmolodenskiy/AlphaPulldown/conda/include' 'CPP=/home/conda/feedstock_root/build_artifacts/curl_split_recipe_1733999596960/_build_env/bin/x86_64-conda-linux-gnu-cpp'"
;;
*)
echo "unknown option: $1"
usage 1
;;
esac
shift
done
exit 0

7
conda/bin/deactivate Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
_CONDA_ROOT="/home/dmolodenskiy/AlphaPulldown/conda"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
\echo >&2 "DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'."
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
conda deactivate

10
conda/bin/distro Executable file
View File

@@ -0,0 +1,10 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from distro.distro import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

BIN
conda/bin/dumpsolv Executable file

Binary file not shown.

BIN
conda/bin/gss-client Executable file

Binary file not shown.

1
conda/bin/idle3 Symbolic link
View File

@@ -0,0 +1 @@
idle3.12

5
conda/bin/idle3.12 Executable file
View File

@@ -0,0 +1,5 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
from idlelib.pyshell import main
if __name__ == '__main__':
main()

BIN
conda/bin/infocmp Executable file

Binary file not shown.

1
conda/bin/infotocap Symbolic link
View File

@@ -0,0 +1 @@
tic

BIN
conda/bin/installcheck Executable file

Binary file not shown.

41
conda/bin/jsondiff Executable file
View File

@@ -0,0 +1,41 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import json
import jsonpatch
import argparse
parser = argparse.ArgumentParser(description='Diff two JSON files')
parser.add_argument('FILE1', type=argparse.FileType('r'))
parser.add_argument('FILE2', type=argparse.FileType('r'))
parser.add_argument('--indent', type=int, default=None,
help='Indent output by n spaces')
parser.add_argument('-u', '--preserve-unicode', action='store_true',
help='Output Unicode character as-is without using Code Point')
parser.add_argument('-v', '--version', action='version',
version='%(prog)s ' + jsonpatch.__version__)
def main():
try:
diff_files()
except KeyboardInterrupt:
sys.exit(1)
def diff_files():
""" Diffs two JSON files and prints a patch """
args = parser.parse_args()
doc1 = json.load(args.FILE1)
doc2 = json.load(args.FILE2)
patch = jsonpatch.make_patch(doc1, doc2)
if patch.patch:
print(json.dumps(patch.patch, indent=args.indent, ensure_ascii=not(args.preserve_unicode)))
sys.exit(1)
if __name__ == "__main__":
main()

107
conda/bin/jsonpatch Executable file
View File

@@ -0,0 +1,107 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python
# -*- coding: utf-8 -*-
import sys
import os.path
import json
import jsonpatch
import tempfile
import argparse
parser = argparse.ArgumentParser(
description='Apply a JSON patch on a JSON file')
parser.add_argument('ORIGINAL', type=argparse.FileType('r'),
help='Original file')
parser.add_argument('PATCH', type=argparse.FileType('r'),
nargs='?', default=sys.stdin,
help='Patch file (read from stdin if omitted)')
parser.add_argument('--indent', type=int, default=None,
help='Indent output by n spaces')
parser.add_argument('-b', '--backup', action='store_true',
help='Back up ORIGINAL if modifying in-place')
parser.add_argument('-i', '--in-place', action='store_true',
help='Modify ORIGINAL in-place instead of to stdout')
parser.add_argument('-v', '--version', action='version',
version='%(prog)s ' + jsonpatch.__version__)
parser.add_argument('-u', '--preserve-unicode', action='store_true',
help='Output Unicode character as-is without using Code Point')
def main():
try:
patch_files()
except KeyboardInterrupt:
sys.exit(1)
def patch_files():
""" Diffs two JSON files and prints a patch """
args = parser.parse_args()
doc = json.load(args.ORIGINAL)
patch = json.load(args.PATCH)
result = jsonpatch.apply_patch(doc, patch)
if args.in_place:
dirname = os.path.abspath(os.path.dirname(args.ORIGINAL.name))
try:
# Attempt to replace the file atomically. We do this by
# creating a temporary file in the same directory as the
# original file so we can atomically move the new file over
# the original later. (This is done in the same directory
# because atomic renames do not work across mount points.)
fd, pathname = tempfile.mkstemp(dir=dirname)
fp = os.fdopen(fd, 'w')
atomic = True
except OSError:
# We failed to create the temporary file for an atomic
# replace, so fall back to non-atomic mode by backing up
# the original (if desired) and writing a new file.
if args.backup:
os.rename(args.ORIGINAL.name, args.ORIGINAL.name + '.orig')
fp = open(args.ORIGINAL.name, 'w')
atomic = False
else:
# Since we're not replacing the original file in-place, write
# the modified JSON to stdout instead.
fp = sys.stdout
# By this point we have some sort of file object we can write the
# modified JSON to.
json.dump(result, fp, indent=args.indent, ensure_ascii=not(args.preserve_unicode))
fp.write('\n')
if args.in_place:
# Close the new file. If we aren't replacing atomically, this
# is our last step, since everything else is already in place.
fp.close()
if atomic:
try:
# Complete the atomic replace by linking the original
# to a backup (if desired), fixing up the permissions
# on the temporary file, and moving it into place.
if args.backup:
os.link(args.ORIGINAL.name, args.ORIGINAL.name + '.orig')
os.chmod(pathname, os.stat(args.ORIGINAL.name).st_mode)
os.rename(pathname, args.ORIGINAL.name)
except OSError:
# In the event we could not actually do the atomic
# replace, unlink the original to move it out of the
# way and finally move the temporary file into place.
os.unlink(args.ORIGINAL.name)
os.rename(pathname, args.ORIGINAL.name)
if __name__ == "__main__":
main()

67
conda/bin/jsonpointer Executable file
View File

@@ -0,0 +1,67 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python
# -*- coding: utf-8 -*-
import argparse
import json
import sys
import jsonpointer
parser = argparse.ArgumentParser(
description='Resolve a JSON pointer on JSON files')
# Accept pointer as argument or as file
ptr_group = parser.add_mutually_exclusive_group(required=True)
ptr_group.add_argument('-f', '--pointer-file', type=argparse.FileType('r'),
nargs='?',
help='File containing a JSON pointer expression')
ptr_group.add_argument('POINTER', type=str, nargs='?',
help='A JSON pointer expression')
parser.add_argument('FILE', type=argparse.FileType('r'), nargs='+',
help='Files for which the pointer should be resolved')
parser.add_argument('--indent', type=int, default=None,
help='Indent output by n spaces')
parser.add_argument('-v', '--version', action='version',
version='%(prog)s ' + jsonpointer.__version__)
def main():
try:
resolve_files()
except KeyboardInterrupt:
sys.exit(1)
def parse_pointer(args):
if args.POINTER:
ptr = args.POINTER
elif args.pointer_file:
ptr = args.pointer_file.read().strip()
else:
parser.print_usage()
sys.exit(1)
return ptr
def resolve_files():
""" Resolve a JSON pointer on JSON files """
args = parser.parse_args()
ptr = parse_pointer(args)
for f in args.FILE:
doc = json.load(f)
try:
result = jsonpointer.resolve_pointer(doc, ptr)
print(json.dumps(result, indent=args.indent))
except jsonpointer.JsonPointerException as e:
print('Could not resolve pointer: %s' % str(e), file=sys.stderr)
if __name__ == "__main__":
main()

123
conda/bin/k5srvutil Executable file
View File

@@ -0,0 +1,123 @@
#!/bin/sh
# list_princs keytab
# returns a list of principals in the keytab
# sorted and uniquified
list_princs() {
klist -k $keytab | awk '(NR > 3) {print $2}' | sort | uniq
}
set_command() {
if [ x$command != x ] ; then
cmd_error Only one command can be specified
usage
exit 1
fi
command=$1
}
#interactive_prompt prompt princ
# If in interactive mode return true if the principal should be acted on
# otherwise return true all the time
interactive_prompt() {
if [ $interactive = 0 ] ; then
return 0
fi
printf "%s for %s? [yn]" "$1" "$2"
read ans
case $ans in
n*|N*)
return 1
;;
esac
return 0
}
cmd_error() {
echo $@ 2>&1
}
usage() {
echo "Usage: $0 [-i] [-f file] [-e keysalts] list|change|delete|delold"
}
change_key() {
princs=`list_princs `
for princ in $princs; do
if interactive_prompt "Change key " $princ; then
kadmin -k -t $keytab -p $princ -q \
"ktadd -k $keytab $keysalts $princ"
fi
done
}
delete_old_keys() {
princs=`list_princs `
for princ in $princs; do
if interactive_prompt "Delete old keys " $princ; then
kadmin -k -t $keytab -p $princ -q "ktrem -k $keytab $princ old"
fi
done
}
delete_keys() {
interactive=1
princs=`list_princs `
for princ in $princs; do
if interactive_prompt "Delete all keys " $princ; then
kadmin -p $princ -k -t $keytab -q "ktrem -k $keytab $princ all"
fi
done
}
keytab=/etc/krb5.keytab
interactive=0
keysalts=""
while [ $# -gt 0 ] ; do
opt=$1
shift
case $opt in
"-f")
keytab=$1
shift
;;
"-i")
interactive=1
;;
"-e")
keysalts="$keysalts -e \"$1\""
shift
;;
change|delold|delete|list)
set_command $opt
;;
*)
cmd_error Illegal option: $opt
usage
exit 1
;;
esac
done
case $command in
change)
change_key
;;
delold)
delete_old_keys
;;
delete)
delete_keys
;;
list)
klist -k $keytab
;;
*)
usage
;;
esac

BIN
conda/bin/kadmin Executable file

Binary file not shown.

BIN
conda/bin/kdestroy Executable file

Binary file not shown.

BIN
conda/bin/keyctl Executable file

Binary file not shown.

BIN
conda/bin/kinit Executable file

Binary file not shown.

BIN
conda/bin/klist Executable file

Binary file not shown.

BIN
conda/bin/kpasswd Executable file

Binary file not shown.

262
conda/bin/krb5-config Executable file
View File

@@ -0,0 +1,262 @@
#!/bin/sh
# Copyright 2001, 2002, 2003 by the Massachusetts Institute of Technology.
# All Rights Reserved.
#
# Export of this software from the United States of America may
# require a specific license from the United States Government.
# It is the responsibility of any person or organization contemplating
# export to obtain such a license before exporting.
#
# WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
# distribute this software and its documentation for any purpose and
# without fee is hereby granted, provided that the above copyright
# notice appear in all copies and that both that copyright notice and
# this permission notice appear in supporting documentation, and that
# the name of M.I.T. not be used in advertising or publicity pertaining
# to distribution of the software without specific, written prior
# permission. Furthermore if you modify this software you must label
# your software as modified software and not distribute it in such a
# fashion that it might be confused with the original M.I.T. software.
# M.I.T. makes no representations about the suitability of
# this software for any purpose. It is provided "as is" without express
# or implied warranty.
#
#
# Configurable parameters set by autoconf
version_string="Kerberos 5 release 1.21.3"
prefix=/home/dmolodenskiy/AlphaPulldown/conda
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
CC_LINK='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)'
KDB5_DB_LIB=
RPATH_FLAG='-Wl,--enable-new-dtags -Wl,-rpath -Wl,'
PROG_RPATH_FLAGS='$(RPATH_FLAG)$(PROG_RPATH)'
PTHREAD_CFLAGS='-pthread'
DL_LIB='-ldl'
DEFCCNAME='FILE:/tmp/krb5cc_%{uid}'
DEFKTNAME='FILE:/etc/krb5.keytab'
DEFCKTNAME='FILE:/opt/conda/var/krb5/user/%{euid}/client.keytab'
LIBS='-lkeyutils -lcrypto -lresolv '
GEN_LIB=
# Defaults for program
library=krb5
# Some constants
vendor_string="Massachusetts Institute of Technology"
# Process arguments
# Yes, we are sloppy, library specifications can come before options
while test $# != 0; do
case $1 in
--all)
do_all=1
;;
--cflags)
do_cflags=1
;;
--defccname)
do_defccname=1
;;
--defcktname)
do_defcktname=1
;;
--defktname)
do_defktname=1
;;
--deps) # historically a no-op
;;
--exec-prefix)
do_exec_prefix=1
;;
--help)
do_help=1
;;
--libs)
do_libs=1
;;
--prefix)
do_prefix=1
;;
--vendor)
do_vendor=1
;;
--version)
do_version=1
;;
krb5)
library=krb5
;;
gssapi)
library=gssapi
;;
gssrpc)
library=gssrpc
;;
kadm-client)
library=kadm_client
;;
kadm-server)
library=kadm_server
;;
kdb)
library=kdb
;;
*)
echo "$0: Unknown option \`$1' -- use \`--help' for usage"
exit 1
esac
shift
done
# If required options - provide help
if test -z "$do_all" -a -z "$do_version" -a -z "$do_vendor" -a \
-z "$do_prefix" -a -z "$do_vendor" -a -z "$do_exec_prefix" -a \
-z "$do_defccname" -a -z "$do_defktname" -a -z "$do_defcktname" -a \
-z "$do_cflags" -a -z "$do_libs"; then
do_help=1
fi
if test -n "$do_help"; then
echo "Usage: $0 [OPTIONS] [LIBRARIES]"
echo "Options:"
echo " [--help] Help"
echo " [--all] Display version, vendor, and various values"
echo " [--version] Version information"
echo " [--vendor] Vendor information"
echo " [--prefix] Kerberos installed prefix"
echo " [--exec-prefix] Kerberos installed exec_prefix"
echo " [--defccname] Show built-in default ccache name"
echo " [--defktname] Show built-in default keytab name"
echo " [--defcktname] Show built-in default client keytab name"
echo " [--cflags] Compile time CFLAGS"
echo " [--libs] List libraries required to link [LIBRARIES]"
echo "Libraries:"
echo " krb5 Kerberos 5 application"
echo " gssapi GSSAPI application with Kerberos 5 bindings"
echo " gssrpc GSSAPI RPC application"
echo " kadm-client Kadmin client"
echo " kadm-server Kadmin server"
echo " kdb Application that accesses the kerberos database"
exit 0
fi
if test -n "$do_all"; then
all_exit=
do_version=1
do_prefix=1
do_exec_prefix=1
do_vendor=1
title_version="Version: "
title_prefix="Prefix: "
title_exec_prefix="Exec_prefix: "
title_vendor="Vendor: "
else
all_exit="exit 0"
fi
if test -n "$do_version"; then
echo "$title_version$version_string"
$all_exit
fi
if test -n "$do_vendor"; then
echo "$title_vendor$vendor_string"
$all_exit
fi
if test -n "$do_prefix"; then
echo "$title_prefix$prefix"
$all_exit
fi
if test -n "$do_exec_prefix"; then
echo "$title_exec_prefix$exec_prefix"
$all_exit
fi
if test -n "$do_defccname"; then
echo "$DEFCCNAME"
$all_exit
fi
if test -n "$do_defktname"; then
echo "$DEFKTNAME"
$all_exit
fi
if test -n "$do_defcktname"; then
echo "$DEFCKTNAME"
$all_exit
fi
if test -n "$do_cflags"; then
if test x"$includedir" != x"/usr/include" ; then
echo "-I${includedir}"
else
echo ''
fi
fi
if test -n "$do_libs"; then
# Assumes /usr/lib is the standard library directory everywhere...
if test "$libdir" = /usr/lib; then
libdirarg=
else
libdirarg="-L$libdir"
fi
# Ugly gross hack for our build tree
lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \
-e 's/\$(PURE)//' \
-e 's#\$(PROG_RPATH_FLAGS)#'"$PROG_RPATH_FLAGS"'#' \
-e 's#\$(PROG_RPATH)#'$libdir'#' \
-e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \
-e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \
-e 's#\$(LDFLAGS)##' \
-e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
-e 's#\$(CFLAGS)##'`
if test $library = 'kdb'; then
lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB"
library=krb5
fi
if test $library = 'kadm_server'; then
lib_flags="$lib_flags -lkadm5srv_mit -lkdb5 $KDB5_DB_LIB"
library=gssrpc
fi
if test $library = 'kadm_client'; then
lib_flags="$lib_flags -lkadm5clnt_mit"
library=gssrpc
fi
if test $library = 'gssrpc'; then
lib_flags="$lib_flags -lgssrpc"
library=gssapi
fi
if test $library = 'gssapi'; then
lib_flags="$lib_flags -lgssapi_krb5"
library=krb5
fi
if test $library = 'krb5'; then
lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err"
fi
# If we ever support a flag to generate output suitable for static
# linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB"
# here.
echo $lib_flags
fi
exit 0

BIN
conda/bin/ksu Normal file

Binary file not shown.

BIN
conda/bin/kswitch Executable file

Binary file not shown.

BIN
conda/bin/ktutil Executable file

Binary file not shown.

BIN
conda/bin/kvno Executable file

Binary file not shown.

BIN
conda/bin/lz4 Executable file

Binary file not shown.

1
conda/bin/lz4c Symbolic link
View File

@@ -0,0 +1 @@
lz4

1
conda/bin/lz4cat Symbolic link
View File

@@ -0,0 +1 @@
lz4

11
conda/bin/mamba Executable file
View File

@@ -0,0 +1,11 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from mamba.mamba import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

BIN
conda/bin/mamba-package Executable file

Binary file not shown.

BIN
conda/bin/mergesolv Executable file

Binary file not shown.

331
conda/bin/ncurses6-config Executable file
View File

@@ -0,0 +1,331 @@
#!/bin/sh
# $Id: ncurses-config.in,v 1.52 2022/07/26 21:36:28 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 2006-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# to deal in the Software without restriction, including without limitation #
# the rights to use, copy, modify, merge, publish, distribute, distribute #
# with modifications, sublicense, and/or sell copies of the Software, and to #
# permit persons to whom the Software is furnished to do so, subject to the #
# following conditions: #
# #
# The above copyright notice and this permission notice shall be included in #
# all copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
# DEALINGS IN THE SOFTWARE. #
# #
# Except as contained in this notice, the name(s) of the above copyright #
# holders shall not be used in advertising or otherwise to promote the sale, #
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
#
# Author: Thomas E. Dickey, 2006-on
LANG=C; export LANG
LANGUAGE=C; export LANGUAGE
LC_ALL=C; export LC_ALL
LC_CTYPE=C; export LC_CTYPE
prefix="/home/dmolodenskiy/AlphaPulldown/conda"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
includedir="${prefix}/include"
libdir="${exec_prefix}/lib"
datarootdir="${prefix}/share"
datadir="${datarootdir}"
mandir="${datarootdir}/man"
THIS="ncurses"
TINFO_LIB="tinfo"
RPATH_LIST="${libdir}"
includesubdir="${prefix}/include/${THIS}"
# Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.
# We cannot filter it out within the build-process since the variable is used
# in some special cases of installation using a relative path.
if [ -n "$RPATH_LIST" ]
then
save_IFS="$IFS"
IFS=':'
filtered=
for item in $RPATH_LIST
do
case "$item" in
./*|../*|*/..|*/../*)
;;
*)
[ -n "$filtered" ] && filtered="${filtered}:"
filtered="${filtered}${item}"
;;
esac
done
IFS="$save_IFS"
# if the result is empty, there is little we can do to fix it
RPATH_LIST="$filtered"
fi
# with --disable-overwrite, we installed into a subdirectory, but transformed
# the headers to include like this:
# <ncurses/curses.h>
if [ xno = xno ]; then
case $includedir in
$prefix/include/ncurses)
includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
;;
esac
fi
LIBS=""
if [ "tinfo" = "ncurses" ]; then
LIBS="-l${THIS} $LIBS"
else
LIBS="-l${THIS} -l${TINFO_LIB} $LIBS"
fi
# Ignore -L options which do not correspond to an actual directory, or which
# are standard library directories (i.e., the linker is supposed to search
# those directories).
#
# There is no portable way to find the list of standard library directories.
# Require a POSIX shell anyway, to keep this simple.
lib_flags=
for opt in -L$libdir -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/dmolodenskiy/AlphaPulldown/conda/lib -Wl,-rpath-link,/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib $LIBS
do
case $opt in
-specs*) # ignore linker specs-files which were used to build library
continue
;;
-Wl,-z,*) # ignore flags used to manipulate shared image
continue
;;
-Wl,--dynamic-linker*) # ignore ELF interpreter
continue
;;
-Wl,--as-needed|-Wl,--build-id=*|-Wl,-dT,*|-Wl,-T,*)
continue
;;
-L*)
lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
[ -d "$lib_check" ] || continue
case "$lib_check" in
/usr/local/lib64|/lib64|/usr/lib64|/usr/local/lib|/lib|/usr/lib) # skip standard libdir
if [ "$lib_check" = "$libdir" ]
then
lib_first=yes
IFS_save="$IFS"
IFS='|'
LIBDIRS="/usr/local/lib64|/lib64|/usr/lib64|/usr/local/lib|/lib|/usr/lib"
for lib_check in $LIBDIRS
do
if [ -d "$lib_check" ]
then
if [ "$lib_check" != "$libdir" ]
then
lib_first=no
fi
break
fi
done
IFS="$IFS_save"
[ $lib_first = yes ] && continue
found=no
for check in $lib_flags
do
if [ "x$check" = "x$opt" ]
then
found=yes
break
fi
done
[ $found = yes ] && continue
:
else
continue
fi
;;
*)
found=no
for check in $lib_flags
do
if [ "x$check" = "x$opt" ]
then
found=yes
break
fi
done
[ $found = yes ] && continue
;;
esac
;;
esac
lib_flags="$lib_flags $opt"
done
[ $# = 0 ] && exec /bin/sh "$0" --error
while [ $# -gt 0 ]; do
case "$1" in
# basic configuration
--prefix)
echo "$prefix"
;;
--exec-prefix)
echo "$exec_prefix"
;;
# compile/link
--cflags)
INCS=" -D_GNU_SOURCE"
if [ "xno" = xno ]; then
INCS="$INCS -I${includesubdir}"
fi
if [ "${includedir}" != /usr/include ]; then
INCS="$INCS -I${includedir}"
fi
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
$INCS
ENDECHO
;;
--libs)
OPTS=
for opt in $lib_flags
do
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
done
printf '%s\n' "$OPTS"
;;
--libs-only-L)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-L*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf '%s\n' "$OPTS"
;;
--libs-only-l)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-l*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf '%s\n' "$OPTS"
;;
--libs-only-other)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-[lL]*)
;;
*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf '%s\n' "$OPTS"
;;
# identification
--version)
echo "6.5.20240427"
;;
--abi-version)
echo "6"
;;
--mouse-version)
echo "2"
;;
# locations
--bindir)
echo "${bindir}"
;;
--datadir)
echo "${datadir}"
;;
--includedir)
INCS=
if [ "xno" = xno ]; then
INCS="${includesubdir}"
elif [ "${includedir}" != /usr/include ]; then
INCS="${includedir}"
fi
echo "$INCS"
;;
--libdir)
echo "${libdir}"
;;
--mandir)
echo "${mandir}"
;;
--terminfo)
echo "/home/dmolodenskiy/AlphaPulldown/conda/share/terminfo"
;;
--terminfo-dirs)
echo "/home/dmolodenskiy/AlphaPulldown/conda/share/terminfo"
;;
--termpath)
echo "/etc/termcap:/usr/share/misc/termcap"
;;
# general info
--help)
cat <<ENDHELP
Usage: `basename "$0"` [options]
Options:
--prefix echos the package-prefix of ${THIS}
--exec-prefix echos the executable-prefix of ${THIS}
--cflags echos the C compiler flags needed to compile with ${THIS}
--libs echos the libraries needed to link with ${THIS}
--libs-only-L echos -L linker options (search path) for ${THIS}
--libs-only-l echos -l linker options (libraries) for ${THIS}
--libs-only-other echos linker options other than -L/-l
--version echos the release+patchdate version of ${THIS}
--abi-version echos the ABI version of ${THIS}
--mouse-version echos the mouse-interface version of ${THIS}
--bindir echos the directory containing ${THIS} programs
--datadir echos the directory containing ${THIS} data
--includedir echos the directory containing ${THIS} header files
--libdir echos the directory containing ${THIS} libraries
--mandir echos the directory containing ${THIS} manpages
--terminfo echos the \$TERMINFO terminfo database path
--terminfo-dirs echos the \$TERMINFO_DIRS directory list
--termpath echos the \$TERMPATH termcap list
--help prints this message
ENDHELP
;;
--error|*)
/bin/sh "$0" --help 1>&2
exit 1
;;
esac
shift
done
# vi:ts=4 sw=4
# vile:shmode

331
conda/bin/ncursesw6-config Executable file
View File

@@ -0,0 +1,331 @@
#!/bin/sh
# $Id: ncurses-config.in,v 1.52 2022/07/26 21:36:28 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 2006-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# to deal in the Software without restriction, including without limitation #
# the rights to use, copy, modify, merge, publish, distribute, distribute #
# with modifications, sublicense, and/or sell copies of the Software, and to #
# permit persons to whom the Software is furnished to do so, subject to the #
# following conditions: #
# #
# The above copyright notice and this permission notice shall be included in #
# all copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
# DEALINGS IN THE SOFTWARE. #
# #
# Except as contained in this notice, the name(s) of the above copyright #
# holders shall not be used in advertising or otherwise to promote the sale, #
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
#
# Author: Thomas E. Dickey, 2006-on
LANG=C; export LANG
LANGUAGE=C; export LANGUAGE
LC_ALL=C; export LC_ALL
LC_CTYPE=C; export LC_CTYPE
prefix="/home/dmolodenskiy/AlphaPulldown/conda"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
includedir="${prefix}/include"
libdir="${exec_prefix}/lib"
datarootdir="${prefix}/share"
datadir="${datarootdir}"
mandir="${datarootdir}/man"
THIS="ncursesw"
TINFO_LIB="tinfow"
RPATH_LIST="${libdir}"
includesubdir="${prefix}/include/${THIS}"
# Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.
# We cannot filter it out within the build-process since the variable is used
# in some special cases of installation using a relative path.
if [ -n "$RPATH_LIST" ]
then
save_IFS="$IFS"
IFS=':'
filtered=
for item in $RPATH_LIST
do
case "$item" in
./*|../*|*/..|*/../*)
;;
*)
[ -n "$filtered" ] && filtered="${filtered}:"
filtered="${filtered}${item}"
;;
esac
done
IFS="$save_IFS"
# if the result is empty, there is little we can do to fix it
RPATH_LIST="$filtered"
fi
# with --disable-overwrite, we installed into a subdirectory, but transformed
# the headers to include like this:
# <ncursesw/curses.h>
if [ xno = xno ]; then
case $includedir in
$prefix/include/ncursesw)
includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
;;
esac
fi
LIBS=""
if [ "tinfo" = "ncurses" ]; then
LIBS="-l${THIS} $LIBS"
else
LIBS="-l${THIS} -l${TINFO_LIB} $LIBS"
fi
# Ignore -L options which do not correspond to an actual directory, or which
# are standard library directories (i.e., the linker is supposed to search
# those directories).
#
# There is no portable way to find the list of standard library directories.
# Require a POSIX shell anyway, to keep this simple.
lib_flags=
for opt in -L$libdir -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/dmolodenskiy/AlphaPulldown/conda/lib -Wl,-rpath-link,/home/dmolodenskiy/AlphaPulldown/conda/lib -L/home/dmolodenskiy/AlphaPulldown/conda/lib $LIBS
do
case $opt in
-specs*) # ignore linker specs-files which were used to build library
continue
;;
-Wl,-z,*) # ignore flags used to manipulate shared image
continue
;;
-Wl,--dynamic-linker*) # ignore ELF interpreter
continue
;;
-Wl,--as-needed|-Wl,--build-id=*|-Wl,-dT,*|-Wl,-T,*)
continue
;;
-L*)
lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
[ -d "$lib_check" ] || continue
case "$lib_check" in
/usr/local/lib64|/lib64|/usr/lib64|/usr/local/lib|/lib|/usr/lib) # skip standard libdir
if [ "$lib_check" = "$libdir" ]
then
lib_first=yes
IFS_save="$IFS"
IFS='|'
LIBDIRS="/usr/local/lib64|/lib64|/usr/lib64|/usr/local/lib|/lib|/usr/lib"
for lib_check in $LIBDIRS
do
if [ -d "$lib_check" ]
then
if [ "$lib_check" != "$libdir" ]
then
lib_first=no
fi
break
fi
done
IFS="$IFS_save"
[ $lib_first = yes ] && continue
found=no
for check in $lib_flags
do
if [ "x$check" = "x$opt" ]
then
found=yes
break
fi
done
[ $found = yes ] && continue
:
else
continue
fi
;;
*)
found=no
for check in $lib_flags
do
if [ "x$check" = "x$opt" ]
then
found=yes
break
fi
done
[ $found = yes ] && continue
;;
esac
;;
esac
lib_flags="$lib_flags $opt"
done
[ $# = 0 ] && exec /bin/sh "$0" --error
while [ $# -gt 0 ]; do
case "$1" in
# basic configuration
--prefix)
echo "$prefix"
;;
--exec-prefix)
echo "$exec_prefix"
;;
# compile/link
--cflags)
INCS=" -D_GNU_SOURCE -DNCURSES_WIDECHAR"
if [ "xno" = xno ]; then
INCS="$INCS -I${includesubdir}"
fi
if [ "${includedir}" != /usr/include ]; then
INCS="$INCS -I${includedir}"
fi
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
$INCS
ENDECHO
;;
--libs)
OPTS=
for opt in $lib_flags
do
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
done
printf '%s\n' "$OPTS"
;;
--libs-only-L)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-L*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf '%s\n' "$OPTS"
;;
--libs-only-l)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-l*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf '%s\n' "$OPTS"
;;
--libs-only-other)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-[lL]*)
;;
*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf '%s\n' "$OPTS"
;;
# identification
--version)
echo "6.5.20240427"
;;
--abi-version)
echo "6"
;;
--mouse-version)
echo "2"
;;
# locations
--bindir)
echo "${bindir}"
;;
--datadir)
echo "${datadir}"
;;
--includedir)
INCS=
if [ "xno" = xno ]; then
INCS="${includesubdir}"
elif [ "${includedir}" != /usr/include ]; then
INCS="${includedir}"
fi
echo "$INCS"
;;
--libdir)
echo "${libdir}"
;;
--mandir)
echo "${mandir}"
;;
--terminfo)
echo "/home/dmolodenskiy/AlphaPulldown/conda/share/terminfo"
;;
--terminfo-dirs)
echo "/home/dmolodenskiy/AlphaPulldown/conda/share/terminfo"
;;
--termpath)
echo "/etc/termcap:/usr/share/misc/termcap"
;;
# general info
--help)
cat <<ENDHELP
Usage: `basename "$0"` [options]
Options:
--prefix echos the package-prefix of ${THIS}
--exec-prefix echos the executable-prefix of ${THIS}
--cflags echos the C compiler flags needed to compile with ${THIS}
--libs echos the libraries needed to link with ${THIS}
--libs-only-L echos -L linker options (search path) for ${THIS}
--libs-only-l echos -l linker options (libraries) for ${THIS}
--libs-only-other echos linker options other than -L/-l
--version echos the release+patchdate version of ${THIS}
--abi-version echos the ABI version of ${THIS}
--mouse-version echos the mouse-interface version of ${THIS}
--bindir echos the directory containing ${THIS} programs
--datadir echos the directory containing ${THIS} data
--includedir echos the directory containing ${THIS} header files
--libdir echos the directory containing ${THIS} libraries
--mandir echos the directory containing ${THIS} manpages
--terminfo echos the \$TERMINFO terminfo database path
--terminfo-dirs echos the \$TERMINFO_DIRS directory list
--termpath echos the \$TERMPATH termcap list
--help prints this message
ENDHELP
;;
--error|*)
/bin/sh "$0" --help 1>&2
exit 1
;;
esac
shift
done
# vi:ts=4 sw=4
# vile:shmode

BIN
conda/bin/nghttp Executable file

Binary file not shown.

BIN
conda/bin/nghttpd Executable file

Binary file not shown.

BIN
conda/bin/nghttpx Executable file

Binary file not shown.

10
conda/bin/normalizer Executable file
View File

@@ -0,0 +1,10 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from charset_normalizer.cli import cli_detect
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(cli_detect())

BIN
conda/bin/openssl Executable file

Binary file not shown.

10
conda/bin/pip Executable file
View File

@@ -0,0 +1,10 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

10
conda/bin/pip3 Executable file
View File

@@ -0,0 +1,10 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

1
conda/bin/pydoc Symbolic link
View File

@@ -0,0 +1 @@
pydoc3.12

1
conda/bin/pydoc3 Symbolic link
View File

@@ -0,0 +1 @@
pydoc3.12

5
conda/bin/pydoc3.12 Executable file
View File

@@ -0,0 +1,5 @@
#!/home/dmolodenskiy/AlphaPulldown/conda/bin/python3.12
import pydoc
if __name__ == '__main__':
pydoc.cli()

1
conda/bin/python Symbolic link
View File

@@ -0,0 +1 @@
python3.12

1
conda/bin/python3 Symbolic link
View File

@@ -0,0 +1 @@
python3.12

1
conda/bin/python3-config Symbolic link
View File

@@ -0,0 +1 @@
python3.12-config

1
conda/bin/python3.1 Symbolic link
View File

@@ -0,0 +1 @@
python3.12

BIN
conda/bin/python3.12 Executable file

Binary file not shown.

116
conda/bin/python3.12-config Executable file
View File

@@ -0,0 +1,116 @@
#!/bin/sh
# Keep this script in sync with python-config.in
exit_with_usage ()
{
echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed"
exit $1
}
if [ "$1" = "" ] ; then
exit_with_usage 1
fi
# Returns the actual prefix where this script was installed to.
installed_prefix ()
{
RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
if which readlink >/dev/null 2>&1 ; then
if readlink -f "$RESULT" >/dev/null 2>&1; then
RESULT=$(readlink -f "$RESULT")
fi
fi
echo $RESULT
}
prefix_real=$(installed_prefix "$0")
# Use sed to fix paths from their built-to locations to their installed-to
# locations. Keep prefix & exec_prefix using their original values in case
# they are referenced in other configure variables, to prevent double
# substitution, issue #22140.
prefix="/home/dmolodenskiy/AlphaPulldown/conda"
exec_prefix="${prefix}"
exec_prefix_real=${prefix_real}
includedir=$(echo "${prefix}/include" | sed "s#$prefix#$prefix_real#")
libdir=$(echo "${exec_prefix}/lib" | sed "s#$prefix#$prefix_real#")
CFLAGS=$(echo "-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -ffunction-sections -pipe -isystem /home/dmolodenskiy/AlphaPulldown/conda/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1733407224341/work=/usr/local/src/conda/python-3.12.8 -fdebug-prefix-map=/home/dmolodenskiy/AlphaPulldown/conda=/usr/local/src/conda-prefix -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -flto" | sed "s#$prefix#$prefix_real#")
VERSION="3.12"
LIBM="-lm"
LIBC=""
SYSLIBS="$LIBM $LIBC"
ABIFLAGS=""
LIBS=" -lpthread -ldl -lutil $SYSLIBS"
LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} -lpthread -ldl -lutil $SYSLIBS"
BASECFLAGS=" -fno-strict-overflow -Wsign-compare"
LDLIBRARY="libpython${VERSION}${ABIFLAGS}.a"
OPT="-DNDEBUG -O3 -Wall"
PY_ENABLE_SHARED="0"
LDVERSION="${VERSION}${ABIFLAGS}"
LIBDEST=${prefix_real}/lib/python${VERSION}
LIBPL=$(echo "${prefix}/lib/python3.12/config-${VERSION}${ABIFLAGS}-x86_64-linux-gnu" | sed "s#$prefix#$prefix_real#")
SO=".cpython-312-x86_64-linux-gnu.so"
PYTHONFRAMEWORK=""
INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
PY_EMBED=0
# Scan for --help or unknown argument.
for ARG in $*
do
case $ARG in
--help)
exit_with_usage 0
;;
--embed)
PY_EMBED=1
;;
--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
;;
*)
exit_with_usage 1
;;
esac
done
if [ $PY_EMBED = 1 ] ; then
LIBS="$LIBS_EMBED"
fi
for ARG in "$@"
do
case "$ARG" in
--prefix)
echo "$prefix_real"
;;
--exec-prefix)
echo "$exec_prefix_real"
;;
--includes)
echo "$INCDIR $PLATINCDIR"
;;
--cflags)
echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
;;
--libs)
echo "$LIBS"
;;
--ldflags)
LIBPLUSED=
if [ "$PY_ENABLE_SHARED" = "0" ] ; then
LIBPLUSED="-L$LIBPL"
fi
echo "$LIBPLUSED -L$libdir $LIBS"
;;
--extension-suffix)
echo "$SO"
;;
--abiflags)
echo "$ABIFLAGS"
;;
--configdir)
echo "$LIBPL"
;;
esac
done

BIN
conda/bin/repo2solv Executable file

Binary file not shown.

1
conda/bin/reset Symbolic link
View File

@@ -0,0 +1 @@
tset

BIN
conda/bin/sclient Executable file

Binary file not shown.

BIN
conda/bin/sim_client Executable file

Binary file not shown.

899
conda/bin/sqlite3_analyzer Executable file
View File

@@ -0,0 +1,899 @@
#! /bin/sh
# restart with tclsh \
exec tclsh "$0" ${1+"$@"}
package require sqlite3
# Run this TCL script using an SQLite-enabled TCL interpreter to get a report
# on how much disk space is used by a particular data to actually store data
# versus how much space is unused.
#
# The dbstat virtual table is required.
#
if {[catch {
# Argument $tname is the name of a table within the database opened by
# database handle [db]. Return true if it is a WITHOUT ROWID table, or
# false otherwise.
#
proc is_without_rowid {tname} {
set t [string map {' ''} $tname]
db eval "PRAGMA index_list = '$t'" o {
if {$o(origin) == "pk"} {
set n $o(name)
if {0==[db one { SELECT count(*) FROM sqlite_schema WHERE name=$n }]} {
return 1
}
}
}
return 0
}
# Read and run TCL commands from standard input. Used to implement
# the --tclsh option.
#
proc tclsh {} {
set line {}
while {![eof stdin]} {
if {$line!=""} {
puts -nonewline "> "
} else {
puts -nonewline "% "
}
flush stdout
append line [gets stdin]
if {[info complete $line]} {
if {[catch {uplevel #0 $line} result]} {
puts stderr "Error: $result"
} elseif {$result!=""} {
puts $result
}
set line {}
} else {
append line \n
}
}
}
# Get the name of the database to analyze
#
proc usage {} {
set argv0 [file rootname [file tail [info script]]]
puts stderr "Usage: $argv0 ?--pageinfo? ?--stats? database-filename"
puts stderr {
Analyze the SQLite3 database file specified by the "database-filename"
argument and output a report detailing size and storage efficiency
information for the database and its constituent tables and indexes.
Options:
--pageinfo Show how each page of the database-file is used
--stats Output SQL text that creates a new database containing
statistics about the database that was analyzed
--tclsh Run the built-in TCL interpreter interactively (for debugging)
--version Show the version number of SQLite
}
exit 1
}
set file_to_analyze {}
set flags(-pageinfo) 0
set flags(-stats) 0
set flags(-debug) 0
append argv {}
foreach arg $argv {
if {[regexp {^-+pageinfo$} $arg]} {
set flags(-pageinfo) 1
} elseif {[regexp {^-+stats$} $arg]} {
set flags(-stats) 1
} elseif {[regexp {^-+debug$} $arg]} {
set flags(-debug) 1
} elseif {[regexp {^-+tclsh$} $arg]} {
tclsh
exit 0
} elseif {[regexp {^-+version$} $arg]} {
sqlite3 mem :memory:
puts [mem one {SELECT sqlite_version()||' '||sqlite_source_id()}]
mem close
exit 0
} elseif {[regexp {^-} $arg]} {
puts stderr "Unknown option: $arg"
usage
} elseif {$file_to_analyze!=""} {
usage
} else {
set file_to_analyze $arg
}
}
if {$file_to_analyze==""} usage
set root_filename $file_to_analyze
regexp {^file:(//)?([^?]*)} $file_to_analyze all x1 root_filename
if {![file exists $root_filename]} {
puts stderr "No such file: $root_filename"
exit 1
}
if {![file readable $root_filename]} {
puts stderr "File is not readable: $root_filename"
exit 1
}
set true_file_size [file size $root_filename]
if {$true_file_size<512} {
puts stderr "Empty or malformed database: $root_filename"
exit 1
}
# Compute the total file size assuming test_multiplexor is being used.
# Assume that SQLITE_ENABLE_8_3_NAMES might be enabled
#
set extension [file extension $root_filename]
set pattern $root_filename
append pattern {[0-3][0-9][0-9]}
foreach f [glob -nocomplain $pattern] {
incr true_file_size [file size $f]
set extension {}
}
if {[string length $extension]>=2 && [string length $extension]<=4} {
set pattern [file rootname $root_filename]
append pattern {.[0-3][0-9][0-9]}
foreach f [glob -nocomplain $pattern] {
incr true_file_size [file size $f]
}
}
# Open the database
#
if {[catch {sqlite3 db $file_to_analyze -uri 1} msg]} {
puts stderr "error trying to open $file_to_analyze: $msg"
exit 1
}
if {$flags(-debug)} {
proc dbtrace {txt} {puts $txt; flush stdout;}
db trace ::dbtrace
}
# Make sure all required compile-time options are available
#
if {![db exists {SELECT 1 FROM pragma_compile_options
WHERE compile_options='ENABLE_DBSTAT_VTAB'}]} {
puts "The SQLite database engine linked with this application\
lacks required capabilities. Recompile using the\
-DSQLITE_ENABLE_DBSTAT_VTAB compile-time option to fix\
this problem."
exit 1
}
db eval {SELECT count(*) FROM sqlite_schema}
set pageSize [expr {wide([db one {PRAGMA page_size}])}]
if {$flags(-pageinfo)} {
db eval {CREATE VIRTUAL TABLE temp.stat USING dbstat}
db eval {SELECT name, path, pageno FROM temp.stat ORDER BY pageno} {
puts "$pageno $name $path"
}
exit 0
}
if {$flags(-stats)} {
db eval {CREATE VIRTUAL TABLE temp.stat USING dbstat}
puts "BEGIN;"
puts "CREATE TABLE stats("
puts " name STRING, /* Name of table or index */"
puts " path INTEGER, /* Path to page from root */"
puts " pageno INTEGER, /* Page number */"
puts " pagetype STRING, /* 'internal', 'leaf' or 'overflow' */"
puts " ncell INTEGER, /* Cells on page (0 for overflow) */"
puts " payload INTEGER, /* Bytes of payload on this page */"
puts " unused INTEGER, /* Bytes of unused space on this page */"
puts " mx_payload INTEGER, /* Largest payload size of all cells */"
puts " pgoffset INTEGER, /* Offset of page in file */"
puts " pgsize INTEGER /* Size of the page */"
puts ");"
db eval {SELECT quote(name) || ',' ||
quote(path) || ',' ||
quote(pageno) || ',' ||
quote(pagetype) || ',' ||
quote(ncell) || ',' ||
quote(payload) || ',' ||
quote(unused) || ',' ||
quote(mx_payload) || ',' ||
quote(pgoffset) || ',' ||
quote(pgsize) AS x FROM stat} {
puts "INSERT INTO stats VALUES($x);"
}
puts "COMMIT;"
exit 0
}
# In-memory database for collecting statistics. This script loops through
# the tables and indices in the database being analyzed, adding a row for each
# to an in-memory database (for which the schema is shown below). It then
# queries the in-memory db to produce the space-analysis report.
#
sqlite3 mem :memory:
if {$flags(-debug)} {
proc dbtrace {txt} {puts $txt; flush stdout;}
mem trace ::dbtrace
}
set tabledef {CREATE TABLE space_used(
name clob, -- Name of a table or index in the database file
tblname clob, -- Name of associated table
is_index boolean, -- TRUE if it is an index, false for a table
is_without_rowid boolean, -- TRUE if WITHOUT ROWID table
nentry int, -- Number of entries in the BTree
leaf_entries int, -- Number of leaf entries
depth int, -- Depth of the b-tree
payload int, -- Total amount of data stored in this table or index
ovfl_payload int, -- Total amount of data stored on overflow pages
ovfl_cnt int, -- Number of entries that use overflow
mx_payload int, -- Maximum payload size
int_pages int, -- Number of interior pages used
leaf_pages int, -- Number of leaf pages used
ovfl_pages int, -- Number of overflow pages used
int_unused int, -- Number of unused bytes on interior pages
leaf_unused int, -- Number of unused bytes on primary pages
ovfl_unused int, -- Number of unused bytes on overflow pages
gap_cnt int, -- Number of gaps in the page layout
compressed_size int -- Total bytes stored on disk
);}
mem eval $tabledef
# Create a temporary "dbstat" virtual table.
#
db eval {CREATE VIRTUAL TABLE temp.stat USING dbstat}
db eval {CREATE TEMP TABLE dbstat AS SELECT * FROM temp.stat
ORDER BY name, path}
db eval {DROP TABLE temp.stat}
set isCompressed 0
set compressOverhead 0
set depth 0
set sql { SELECT name, tbl_name FROM sqlite_schema WHERE rootpage>0 }
foreach {name tblname} [concat sqlite_schema sqlite_schema [db eval $sql]] {
set is_index [expr {$name!=$tblname}]
set is_without_rowid [is_without_rowid $name]
db eval {
SELECT
sum(ncell) AS nentry,
sum((pagetype=='leaf')*ncell) AS leaf_entries,
sum(payload) AS payload,
sum((pagetype=='overflow') * payload) AS ovfl_payload,
sum(path LIKE '%+000000') AS ovfl_cnt,
max(mx_payload) AS mx_payload,
sum(pagetype=='internal') AS int_pages,
sum(pagetype=='leaf') AS leaf_pages,
sum(pagetype=='overflow') AS ovfl_pages,
sum((pagetype=='internal') * unused) AS int_unused,
sum((pagetype=='leaf') * unused) AS leaf_unused,
sum((pagetype=='overflow') * unused) AS ovfl_unused,
sum(pgsize) AS compressed_size,
max((length(CASE WHEN path LIKE '%+%' THEN '' ELSE path END)+3)/4)
AS depth
FROM temp.dbstat WHERE name = $name
} break
set total_pages [expr {$leaf_pages+$int_pages+$ovfl_pages}]
set storage [expr {$total_pages*$pageSize}]
if {!$isCompressed && $storage>$compressed_size} {
set isCompressed 1
set compressOverhead 14
}
# Column 'gap_cnt' is set to the number of non-contiguous entries in the
# list of pages visited if the b-tree structure is traversed in a top-down
# fashion (each node visited before its child-tree is passed). Any overflow
# chains present are traversed from start to finish before any child-tree
# is.
#
set gap_cnt 0
set prev 0
db eval {
SELECT pageno, pagetype FROM temp.dbstat
WHERE name=$name
ORDER BY pageno
} {
if {$prev>0 && $pagetype=="leaf" && $pageno!=$prev+1} {
incr gap_cnt
}
set prev $pageno
}
mem eval {
INSERT INTO space_used VALUES(
$name,
$tblname,
$is_index,
$is_without_rowid,
$nentry,
$leaf_entries,
$depth,
$payload,
$ovfl_payload,
$ovfl_cnt,
$mx_payload,
$int_pages,
$leaf_pages,
$ovfl_pages,
$int_unused,
$leaf_unused,
$ovfl_unused,
$gap_cnt,
$compressed_size
);
}
}
proc integerify {real} {
if {[string is double -strict $real]} {
return [expr {wide($real)}]
} else {
return 0
}
}
mem function int integerify
# Quote a string for use in an SQL query. Examples:
#
# [quote {hello world}] == {'hello world'}
# [quote {hello world's}] == {'hello world''s'}
#
proc quote {txt} {
return [string map {' ''} $txt]
}
# Output a title line
#
proc titleline {title} {
if {$title==""} {
puts [string repeat * 79]
} else {
set len [string length $title]
set stars [string repeat * [expr {79-$len-5}]]
puts "*** $title $stars"
}
}
# Generate a single line of output in the statistics section of the
# report.
#
proc statline {title value {extra {}}} {
set len [string length $title]
set dots [string repeat . [expr {50-$len}]]
set len [string length $value]
set sp2 [string range { } $len end]
if {$extra ne ""} {
set extra " $extra"
}
puts "$title$dots $value$sp2$extra"
}
# Generate a formatted percentage value for $num/$denom
#
proc percent {num denom {of {}}} {
if {$denom==0.0} {return ""}
set v [expr {$num*100.0/$denom}]
set of {}
if {$v==100.0 || $v<0.001 || ($v>1.0 && $v<99.0)} {
return [format {%5.1f%% %s} $v $of]
} elseif {$v<0.1 || $v>99.9} {
return [format {%7.3f%% %s} $v $of]
} else {
return [format {%6.2f%% %s} $v $of]
}
}
proc divide {num denom} {
if {$denom==0} {return 0.0}
return [format %.2f [expr {double($num)/double($denom)}]]
}
# Generate a subreport that covers some subset of the database.
# the $where clause determines which subset to analyze.
#
proc subreport {title where showFrag} {
global pageSize file_pgcnt compressOverhead
# Query the in-memory database for the sum of various statistics
# for the subset of tables/indices identified by the WHERE clause in
# $where. Note that even if the WHERE clause matches no rows, the
# following query returns exactly one row (because it is an aggregate).
#
# The results of the query are stored directly by SQLite into local
# variables (i.e. $nentry, $payload etc.).
#
mem eval "
SELECT
int(sum(
CASE WHEN (is_without_rowid OR is_index) THEN nentry
ELSE leaf_entries
END
)) AS nentry,
int(sum(payload)) AS payload,
int(sum(ovfl_payload)) AS ovfl_payload,
max(mx_payload) AS mx_payload,
int(sum(ovfl_cnt)) as ovfl_cnt,
int(sum(leaf_pages)) AS leaf_pages,
int(sum(int_pages)) AS int_pages,
int(sum(ovfl_pages)) AS ovfl_pages,
int(sum(leaf_unused)) AS leaf_unused,
int(sum(int_unused)) AS int_unused,
int(sum(ovfl_unused)) AS ovfl_unused,
int(sum(gap_cnt)) AS gap_cnt,
int(sum(compressed_size)) AS compressed_size,
int(max(depth)) AS depth,
count(*) AS cnt
FROM space_used WHERE $where" {} {}
# Output the sub-report title, nicely decorated with * characters.
#
puts ""
titleline $title
puts ""
# Calculate statistics and store the results in TCL variables, as follows:
#
# total_pages: Database pages consumed.
# total_pages_percent: Pages consumed as a percentage of the file.
# storage: Bytes consumed.
# payload_percent: Payload bytes used as a percentage of $storage.
# total_unused: Unused bytes on pages.
# avg_payload: Average payload per btree entry.
# avg_fanout: Average fanout for internal pages.
# avg_unused: Average unused bytes per btree entry.
# avg_meta: Average metadata overhead per entry.
# ovfl_cnt_percent: Percentage of btree entries that use overflow pages.
#
set total_pages [expr {$leaf_pages+$int_pages+$ovfl_pages}]
set total_pages_percent [percent $total_pages $file_pgcnt]
set storage [expr {$total_pages*$pageSize}]
set payload_percent [percent $payload $storage {of storage consumed}]
set total_unused [expr {$ovfl_unused+$int_unused+$leaf_unused}]
set avg_payload [divide $payload $nentry]
set avg_unused [divide $total_unused $nentry]
set total_meta [expr {$storage - $payload - $total_unused}]
set total_meta [expr {$total_meta + 4*($ovfl_pages - $ovfl_cnt)}]
set meta_percent [percent $total_meta $storage {of metadata}]
set avg_meta [divide $total_meta $nentry]
if {$int_pages>0} {
# TODO: Is this formula correct?
set nTab [mem eval "
SELECT count(*) FROM (
SELECT DISTINCT tblname FROM space_used WHERE $where AND is_index=0
)
"]
set avg_fanout [mem eval "
SELECT (sum(leaf_pages+int_pages)-$nTab)/sum(int_pages) FROM space_used
WHERE $where
"]
set avg_fanout [format %.2f $avg_fanout]
}
set ovfl_cnt_percent [percent $ovfl_cnt $nentry {of all entries}]
# Print out the sub-report statistics.
#
statline {Percentage of total database} $total_pages_percent
statline {Number of entries} $nentry
statline {Bytes of storage consumed} $storage
if {$compressed_size!=$storage} {
set compressed_size [expr {$compressed_size+$compressOverhead*$total_pages}]
set pct [expr {$compressed_size*100.0/$storage}]
set pct [format {%5.1f%%} $pct]
statline {Bytes used after compression} $compressed_size $pct
}
statline {Bytes of payload} $payload $payload_percent
statline {Bytes of metadata} $total_meta $meta_percent
if {$cnt==1} {statline {B-tree depth} $depth}
statline {Average payload per entry} $avg_payload
statline {Average unused bytes per entry} $avg_unused
statline {Average metadata per entry} $avg_meta
if {[info exists avg_fanout]} {
statline {Average fanout} $avg_fanout
}
if {$showFrag && $total_pages>1} {
set fragmentation [percent $gap_cnt [expr {$total_pages-1}]]
statline {Non-sequential pages} $gap_cnt $fragmentation
}
statline {Maximum payload per entry} $mx_payload
statline {Entries that use overflow} $ovfl_cnt $ovfl_cnt_percent
if {$int_pages>0} {
statline {Index pages used} $int_pages
}
statline {Primary pages used} $leaf_pages
statline {Overflow pages used} $ovfl_pages
statline {Total pages used} $total_pages
if {$int_unused>0} {
set int_unused_percent [
percent $int_unused [expr {$int_pages*$pageSize}] {of index space}]
statline "Unused bytes on index pages" $int_unused $int_unused_percent
}
statline "Unused bytes on primary pages" $leaf_unused [
percent $leaf_unused [expr {$leaf_pages*$pageSize}] {of primary space}]
statline "Unused bytes on overflow pages" $ovfl_unused [
percent $ovfl_unused [expr {$ovfl_pages*$pageSize}] {of overflow space}]
statline "Unused bytes on all pages" $total_unused [
percent $total_unused $storage {of all space}]
return 1
}
# Calculate the overhead in pages caused by auto-vacuum.
#
# This procedure calculates and returns the number of pages used by the
# auto-vacuum 'pointer-map'. If the database does not support auto-vacuum,
# then 0 is returned. The two arguments are the size of the database file in
# pages and the page size used by the database (in bytes).
proc autovacuum_overhead {filePages pageSize} {
# Set $autovacuum to non-zero for databases that support auto-vacuum.
set autovacuum [db one {PRAGMA auto_vacuum}]
# If the database is not an auto-vacuum database or the file consists
# of one page only then there is no overhead for auto-vacuum. Return zero.
if {0==$autovacuum || $filePages==1} {
return 0
}
# The number of entries on each pointer map page. The layout of the
# database file is one pointer-map page, followed by $ptrsPerPage other
# pages, followed by a pointer-map page etc. The first pointer-map page
# is the second page of the file overall.
set ptrsPerPage [expr {double($pageSize/5)}]
# Return the number of pointer map pages in the database.
return [expr {wide(ceil(($filePages-1.0)/($ptrsPerPage+1.0)))}]
}
# Calculate the summary statistics for the database and store the results
# in TCL variables. They are output below. Variables are as follows:
#
# pageSize: Size of each page in bytes.
# file_bytes: File size in bytes.
# file_pgcnt: Number of pages in the file.
# file_pgcnt2: Number of pages in the file (calculated).
# av_pgcnt: Pages consumed by the auto-vacuum pointer-map.
# av_percent: Percentage of the file consumed by auto-vacuum pointer-map.
# inuse_pgcnt: Data pages in the file.
# inuse_percent: Percentage of pages used to store data.
# free_pgcnt: Free pages calculated as (<total pages> - <in-use pages>)
# free_pgcnt2: Free pages in the file according to the file header.
# free_percent: Percentage of file consumed by free pages (calculated).
# free_percent2: Percentage of file consumed by free pages (header).
# ntable: Number of tables in the db.
# nindex: Number of indices in the db.
# nautoindex: Number of indices created automatically.
# nmanindex: Number of indices created manually.
# user_payload: Number of bytes of payload in table btrees
# (not including sqlite_schema)
# user_percent: $user_payload as a percentage of total file size.
### The following, setting $file_bytes based on the actual size of the file
### on disk, causes this tool to choke on zipvfs databases. So set it based
### on the return of [PRAGMA page_count] instead.
if 0 {
set file_bytes [file size $file_to_analyze]
set file_pgcnt [expr {$file_bytes/$pageSize}]
}
set file_pgcnt [db one {PRAGMA page_count}]
set file_bytes [expr {$file_pgcnt * $pageSize}]
set av_pgcnt [autovacuum_overhead $file_pgcnt $pageSize]
set av_percent [percent $av_pgcnt $file_pgcnt]
set sql {SELECT sum(leaf_pages+int_pages+ovfl_pages) FROM space_used}
set inuse_pgcnt [expr {wide([mem eval $sql])}]
set inuse_percent [percent $inuse_pgcnt $file_pgcnt]
set free_pgcnt [expr {$file_pgcnt-$inuse_pgcnt-$av_pgcnt}]
set free_percent [percent $free_pgcnt $file_pgcnt]
set free_pgcnt2 [db one {PRAGMA freelist_count}]
set free_percent2 [percent $free_pgcnt2 $file_pgcnt]
set file_pgcnt2 [expr {$inuse_pgcnt+$free_pgcnt2+$av_pgcnt}]
# Account for the lockbyte page
if {$file_pgcnt2*$pageSize>1073742335} {incr file_pgcnt2}
set ntable [db eval {SELECT count(*)+1 FROM sqlite_schema WHERE type='table'}]
set nindex [db eval {SELECT count(*) FROM sqlite_schema WHERE type='index'}]
set sql {SELECT count(*) FROM sqlite_schema WHERE name LIKE 'sqlite_autoindex%'}
set nautoindex [db eval $sql]
set nmanindex [expr {$nindex-$nautoindex}]
# set total_payload [mem eval "SELECT sum(payload) FROM space_used"]
set user_payload [mem one {SELECT int(sum(payload)) FROM space_used
WHERE NOT is_index AND name NOT LIKE 'sqlite_schema'}]
set user_percent [percent $user_payload $file_bytes]
# Output the summary statistics calculated above.
#
puts "/** Disk-Space Utilization Report For $root_filename"
puts ""
statline {Page size in bytes} $pageSize
statline {Pages in the whole file (measured)} $file_pgcnt
statline {Pages in the whole file (calculated)} $file_pgcnt2
statline {Pages that store data} $inuse_pgcnt $inuse_percent
statline {Pages on the freelist (per header)} $free_pgcnt2 $free_percent2
statline {Pages on the freelist (calculated)} $free_pgcnt $free_percent
statline {Pages of auto-vacuum overhead} $av_pgcnt $av_percent
statline {Number of tables in the database} $ntable
statline {Number of indices} $nindex
statline {Number of defined indices} $nmanindex
statline {Number of implied indices} $nautoindex
if {$isCompressed} {
statline {Size of uncompressed content in bytes} $file_bytes
set efficiency [percent $true_file_size $file_bytes]
statline {Size of compressed file on disk} $true_file_size $efficiency
} else {
statline {Size of the file in bytes} $file_bytes
}
statline {Bytes of user payload stored} $user_payload $user_percent
# Output table rankings
#
puts ""
titleline "Page counts for all tables with their indices"
puts ""
mem eval {SELECT tblname, count(*) AS cnt,
int(sum(int_pages+leaf_pages+ovfl_pages)) AS size
FROM space_used GROUP BY tblname ORDER BY size+0 DESC, tblname} {} {
statline [string toupper $tblname] $size [percent $size $file_pgcnt]
}
puts ""
titleline "Page counts for all tables and indices separately"
puts ""
mem eval {
SELECT
upper(name) AS nm,
int(int_pages+leaf_pages+ovfl_pages) AS size
FROM space_used
ORDER BY size+0 DESC, name} {} {
statline $nm $size [percent $size $file_pgcnt]
}
if {$isCompressed} {
puts ""
titleline "Bytes of disk space used after compression"
puts ""
set csum 0
mem eval {SELECT tblname,
int(sum(compressed_size)) +
$compressOverhead*sum(int_pages+leaf_pages+ovfl_pages)
AS csize
FROM space_used GROUP BY tblname ORDER BY csize+0 DESC, tblname} {} {
incr csum $csize
statline [string toupper $tblname] $csize [percent $csize $true_file_size]
}
set overhead [expr {$true_file_size - $csum}]
if {$overhead>0} {
statline {Header and free space} $overhead [percent $overhead $true_file_size]
}
}
# Output subreports
#
if {$nindex>0} {
subreport {All tables and indices} 1 0
}
subreport {All tables} {NOT is_index} 0
if {$nindex>0} {
subreport {All indices} {is_index} 0
}
foreach tbl [mem eval {SELECT DISTINCT tblname name FROM space_used
ORDER BY name}] {
set qn [quote $tbl]
set name [string toupper $tbl]
set n [mem eval {SELECT count(*) FROM space_used WHERE tblname=$tbl}]
if {$n>1} {
set idxlist [mem eval "SELECT name FROM space_used
WHERE tblname='$qn' AND is_index
ORDER BY 1"]
subreport "Table $name and all its indices" "tblname='$qn'" 0
subreport "Table $name w/o any indices" "name='$qn'" 1
if {[llength $idxlist]>1} {
subreport "Indices of table $name" "tblname='$qn' AND is_index" 0
}
foreach idx $idxlist {
set qidx [quote $idx]
subreport "Index [string toupper $idx] of table $name" "name='$qidx'" 1
}
} else {
subreport "Table $name" "name='$qn'" 1
}
}
# Output instructions on what the numbers above mean.
#
puts ""
titleline Definitions
puts {
Page size in bytes
The number of bytes in a single page of the database file.
Usually 1024.
Number of pages in the whole file
}
puts " The number of $pageSize-byte pages that go into forming the complete
database"
puts {
Pages that store data
The number of pages that store data, either as primary B*Tree pages or
as overflow pages. The number at the right is the data pages divided by
the total number of pages in the file.
Pages on the freelist
The number of pages that are not currently in use but are reserved for
future use. The percentage at the right is the number of freelist pages
divided by the total number of pages in the file.
Pages of auto-vacuum overhead
The number of pages that store data used by the database to facilitate
auto-vacuum. This is zero for databases that do not support auto-vacuum.
Number of tables in the database
The number of tables in the database, including the SQLITE_SCHEMA table
used to store schema information.
Number of indices
The total number of indices in the database.
Number of defined indices
The number of indices created using an explicit CREATE INDEX statement.
Number of implied indices
The number of indices used to implement PRIMARY KEY or UNIQUE constraints
on tables.
Size of the file in bytes
The total amount of disk space used by the entire database files.
Bytes of user payload stored
The total number of bytes of user payload stored in the database. The
schema information in the SQLITE_SCHEMA table is not counted when
computing this number. The percentage at the right shows the payload
divided by the total file size.
Percentage of total database
The amount of the complete database file that is devoted to storing
information described by this category.
Number of entries
The total number of B-Tree key/value pairs stored under this category.
Bytes of storage consumed
The total amount of disk space required to store all B-Tree entries
under this category. The is the total number of pages used times
the pages size.
Bytes of payload
The amount of payload stored under this category. Payload is the data
part of table entries and the key part of index entries. The percentage
at the right is the bytes of payload divided by the bytes of storage
consumed.
Bytes of metadata
The amount of formatting and structural information stored in the
table or index. Metadata includes the btree page header, the cell pointer
array, the size field for each cell, the left child pointer or non-leaf
cells, the overflow pointers for overflow cells, and the rowid value for
rowid table cells. In other words, metadata is everything that is neither
unused space nor content. The record header in the payload is counted as
content, not metadata.
Average payload per entry
The average amount of payload on each entry. This is just the bytes of
payload divided by the number of entries.
Average unused bytes per entry
The average amount of free space remaining on all pages under this
category on a per-entry basis. This is the number of unused bytes on
all pages divided by the number of entries.
Non-sequential pages
The number of pages in the table or index that are out of sequence.
Many filesystems are optimized for sequential file access so a small
number of non-sequential pages might result in faster queries,
especially for larger database files that do not fit in the disk cache.
Note that after running VACUUM, the root page of each table or index is
at the beginning of the database file and all other pages are in a
separate part of the database file, resulting in a single non-
sequential page.
Maximum payload per entry
The largest payload size of any entry.
Entries that use overflow
The number of entries that user one or more overflow pages.
Total pages used
This is the number of pages used to hold all information in the current
category. This is the sum of index, primary, and overflow pages.
Index pages used
This is the number of pages in a table B-tree that hold only key (rowid)
information and no data.
Primary pages used
This is the number of B-tree pages that hold both key and data.
Overflow pages used
The total number of overflow pages used for this category.
Unused bytes on index pages
The total number of bytes of unused space on all index pages. The
percentage at the right is the number of unused bytes divided by the
total number of bytes on index pages.
Unused bytes on primary pages
The total number of bytes of unused space on all primary pages. The
percentage at the right is the number of unused bytes divided by the
total number of bytes on primary pages.
Unused bytes on overflow pages
The total number of bytes of unused space on all overflow pages. The
percentage at the right is the number of unused bytes divided by the
total number of bytes on overflow pages.
Unused bytes on all pages
The total number of bytes of unused space on all primary and overflow
pages. The percentage at the right is the number of unused bytes
divided by the total number of bytes.
}
# Output a dump of the in-memory database. This can be used for more
# complex offline analysis.
#
titleline {}
puts "The entire text of this report can be sourced into any SQL database"
puts "engine for further analysis. All of the text above is an SQL comment."
puts "The data used to generate this report follows:"
puts "*/"
puts "BEGIN;"
puts $tabledef
unset -nocomplain x
mem eval {SELECT * FROM space_used} x {
puts -nonewline "INSERT INTO space_used VALUES"
set sep (
foreach col $x(*) {
set v $x($col)
if {$v=="" || ![string is double $v]} {set v '[quote $v]'}
puts -nonewline $sep$v
set sep ,
}
puts ");"
}
puts "COMMIT;"
} err]} {
puts "ERROR: $err"
puts $errorInfo
exit 1
}

BIN
conda/bin/tabs Executable file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More