Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1015 binary cif support #1040

Merged
merged 29 commits into from
May 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
27af64d
Types inference improvements: Structure in StructureParser
papillot Apr 19, 2024
12b3a39
Add molstar as a dependency (importing mol-io)
papillot Apr 19, 2024
06f9638
Allow async parsing methods
papillot Apr 24, 2024
5c8512c
Parsing single model binary cif from RCSB
papillot Apr 24, 2024
d22fde3
Implement core and chem_comp schema
papillot Apr 25, 2024
7cc5177
Use DSSP codes from struct_conf for alpha fold ss assignation
papillot Apr 25, 2024
0a98d4c
Handle `asTrajectory` and `firstModelOnly` flags
papillot Apr 26, 2024
8600fb3
Get connectivity from chem_comp_bond
papillot Apr 27, 2024
562bcee
Update RCSB datasource to default to binary cif files
papillot Apr 27, 2024
5142a68
Add PDBe server as datasource
papillot Apr 27, 2024
1c49703
Use PDBe by default when opening PDB codes
papillot Apr 27, 2024
7b4520c
remove cif-parser.ts file
papillot Apr 27, 2024
e753c61
Rename bcif-parser to cif-parser
papillot Apr 27, 2024
913bc68
type Structure.extraData.cif
papillot Apr 27, 2024
6d5036f
update alphafold datasource suffix
papillot Apr 27, 2024
0be4bdd
ebi.ac.uk does not support requests made on http:// protocol
papillot Apr 27, 2024
36ea60f
fix import
papillot Apr 27, 2024
6a47681
fix: jest cannot import modules from molstar dir
papillot Apr 28, 2024
38136c1
fix: origx property is malformed
papillot Apr 28, 2024
b17f3de
fix: parse connections is broken
papillot Apr 28, 2024
3445e65
fix default export must be CifParser (backwards compatibility)
papillot Apr 28, 2024
c3acca1
remove unused code
papillot Apr 28, 2024
e2b9ec0
fix: float(i) returns 0 if value is missing
papillot Apr 28, 2024
72e1106
4CWU superseded by 6CGV
papillot May 4, 2024
0bca727
fix: operator expression with parentheses breaks parser
papillot May 4, 2024
1974924
fix: compressed cif files are parsed as binary
papillot May 21, 2024
f1e6471
fix: alt-loc is always empty
papillot May 21, 2024
ac675d2
update file header
papillot May 21, 2024
cc34e1d
fix: some entities might be defined but not have any coordinates
papillot May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: alt-loc is always empty
The CIF library returns `0` when a string column is converted to an int array.
The fix here is to map the string array from the column using the String.charCodeAt() function.
papillot committed May 24, 2024
commit f1e647105cee524314290245b8a1c6e8bcd8168e
8 changes: 6 additions & 2 deletions src/parser/cif-parser.ts
Original file line number Diff line number Diff line change
@@ -979,8 +979,12 @@ class CifParser extends StructureParser {
atomStore.serial = atomSite.getField('id')!.toIntArray({start: 0, end: numAtoms}) as unknown as Int32Array
atomStore.bfactor = getFieldAsFloat32(atomSite, 'B_iso_or_equiv', numAtoms)
atomStore.occupancy = getFieldAsFloat32(atomSite, 'occupancy', numAtoms)
atomStore.altloc = atomSite.getField('label_alt_id')!.toIntArray({array: Uint8Array, start: 0, end: numAtoms}) as unknown as Uint8Array


const altlocField = atomSite.getField('label_alt_id')
if (altlocField?.isDefined) {
atomStore.altloc = Uint8Array.from(altlocField.toStringArray(), c => c.charCodeAt(0))
}

const atomnameField = atomSite.getField('label_atom_id')
const elementField = atomSite.getField('type_symbol')
resnameField = atomSite.getField('label_comp_id')!