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

Function smooth

analysis/TMalign.cpp:2392–2434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2390}
2391
2392void smooth(int *sec, int len)
2393{
2394 int i, j;
2395 //smooth single --x-- => -----
2396 for (i=2; i<len-2; i++)
2397 {
2398 if(sec[i]==2 || sec[i]==4)
2399 {
2400 j=sec[i];
2401 if (sec[i-2]!=j && sec[i-1]!=j && sec[i+1]!=j && sec[i+2]!=j)
2402 sec[i]=1;
2403 }
2404 }
2405
2406 // smooth double
2407 // --xx-- => ------
2408 for (i=0; i<len-5; i++)
2409 {
2410 //helix
2411 if (sec[i]!=2 && sec[i+1]!=2 && sec[i+2]==2 && sec[i+3]==2 &&
2412 sec[i+4]!=2 && sec[i+5]!= 2)
2413 {
2414 sec[i+2]=1;
2415 sec[i+3]=1;
2416 }
2417
2418 //beta
2419 if (sec[i]!=4 && sec[i+1]!=4 && sec[i+2]==4 && sec[i+3]==4 &&
2420 sec[i+4]!=4 && sec[i+5]!= 4)
2421 {
2422 sec[i+2]=1;
2423 sec[i+3]=1;
2424 }
2425 }
2426
2427 //smooth connect
2428 for (i=0; i<len-2; i++)
2429 {
2430 if (sec[i]==2 && sec[i+1]!=2 && sec[i+2]==2) sec[i+1]=2;
2431 else if(sec[i]==4 && sec[i+1]!=4 && sec[i+2]==4) sec[i+1]=4;
2432 }
2433
2434}
2435
2436char sec_str(double dis13, double dis14, double dis15,
2437 double dis24, double dis25, double dis35)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected