MCPcopy Create free account
hub / github.com/bytedance/dplm / smooth

Function smooth

analysis/TMscore.cpp:4622–4664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4620}
4621
4622void smooth(int *sec, int len)
4623{
4624 int i, j;
4625 //smooth single --x-- => -----
4626 for (i=2; i<len-2; i++)
4627 {
4628 if(sec[i]==2 || sec[i]==4)
4629 {
4630 j=sec[i];
4631 if (sec[i-2]!=j && sec[i-1]!=j && sec[i+1]!=j && sec[i+2]!=j)
4632 sec[i]=1;
4633 }
4634 }
4635
4636 // smooth double
4637 // --xx-- => ------
4638 for (i=0; i<len-5; i++)
4639 {
4640 //helix
4641 if (sec[i]!=2 && sec[i+1]!=2 && sec[i+2]==2 && sec[i+3]==2 &&
4642 sec[i+4]!=2 && sec[i+5]!= 2)
4643 {
4644 sec[i+2]=1;
4645 sec[i+3]=1;
4646 }
4647
4648 //beta
4649 if (sec[i]!=4 && sec[i+1]!=4 && sec[i+2]==4 && sec[i+3]==4 &&
4650 sec[i+4]!=4 && sec[i+5]!= 4)
4651 {
4652 sec[i+2]=1;
4653 sec[i+3]=1;
4654 }
4655 }
4656
4657 //smooth connect
4658 for (i=0; i<len-2; i++)
4659 {
4660 if (sec[i]==2 && sec[i+1]!=2 && sec[i+2]==2) sec[i+1]=2;
4661 else if(sec[i]==4 && sec[i+1]!=4 && sec[i+2]==4) sec[i+1]=4;
4662 }
4663
4664}
4665
4666void output_pymol(const string xname, const string yname,
4667 const string fname_super, double t[3], double u[3][3], const int ter_opt,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected