contactMap

CoDIAC.contactMap.print_fasta_feature_files(contact_arr, seq, featureStart, N_offset1, featureEnd, C_offset1, feature_minRes, contactFromStart, N_offset2, contactFromEnd, C_offset2, contact_minRes, fastaHeader, contactLabel, outputFileBase, threshold=1, append=True, color='117733', use_ref_seq_aligned=True)[source]

Create a feature file for the ROI_1 (Region of Interest) that has contacts to ROI_2 of an array of interest. This assumes that the region of interest is represented in the rows of the contact_arr.

Parameters:
contact_arr: array

Has rows of the [featureStart, featureEnd] of interest and cols of the [contactFromStart, contactFromEnd] ROI. Cols can be the same or different species

seq: str

Protein sequence used to generate fasta file

featureStart: int

start position of ROI_1, assumes it is in the crystal structure minRes number

N_offset1: int

N terminal offset for ROI_1

featureEnd: int

end position of ROI_1, assumes it is in the crystal structure minRes number

C_offset1: int

C terminal offset for ROI_1

feature_minRes: int

minimum residue of the feature

contactFromStart: int

start position of ROI_2, assumes it is in the crystal structure minRes number

N_offset2: int

N terminal offset for ROI_2

contactFromEnd: int

end position of ROI_1, assumes it is in the crystal structure minRes number

C_offset2: int

C terminal offset for ROI_2

contact_minRes: int

minimum residue of the contact component

fastaHeader: str

fastaHeader to be used to reference in jalview

contactLabel: str

label of feature

outputFileBase: str

file name base to write feature and fasta to (it will be <outputFileBase>.fasta and <outpufileBase>.fea)

threshold: float

binary value of the contact (‘1’) in binary adjacency files

append: bool

Whether to append or overwrite the feature file

color:

color number for javliew to use when loading feature.

use_ref_seq_aligned: bool

True if you want to use the ref_seq_aligned where unmodeled regions have been imputed during translation, otherwise uses structseq

CoDIAC.contactMap.return_interChain_adj(PATH, from_dict, to_dict)[source]

Given two single_chain_dict objects of two entities, return the adjList and the array of contacts between entities. This uses the from_dict as the outer keys of adjList (row values of matrix) and to_dict as the inner keys of adjList (col values of matrix)

Parameters:
PATH: str

Path to where contact maps are

from_dict: dict

The dict created by return_single_chain_dict that will serve as mapping FROM from_dict to to_dict

to_dict: dict

The dict created by return_single_chain_dict that will serve as mapping to_dict

Returns:
adjDict: dict

adjacency dict with outer keys as the from_dict residue numbers, inner keys the to_dict residue numbers and value equal to the contact made between pair of residues (binary value from adjacency file)

arr: array

Array with from_dict x to_dict size (numresidues) and values equal to the contact value from adjDict

CoDIAC.contactMap.translate_chainMap_to_RefSeq(entity, pdbClass)[source]

Given a chainMap class, which includes the defined entity, use the pdbClass information to return a new chainMap class that is aligned to the reference sequence positions and full sequence expected.

Parameters:
chain: chainMap

a chainMap created from a contact file

pdbClass: pdbClass

a pdbClass created from the annotation file for the matching PDB ID of chainMap

Returns:
chainMap_aligned: chainMap
A new chainmap that updates the residue numbers and array. This object appends the following things:
offset: int

The offset required to map from refseq to the pdb contact map file if returning to that structure file

ERROR_CODE: int

0 if no errors, otherwise following codes are indicated. 1:no match found; 2:issue between struct and reference sequences after alignment; 3:struct and reference were different lengths