diff --git a/examples/filtering_example/README.txt b/examples/filtering_example/README.txt new file mode 100644 index 00000000..00a7fbce --- /dev/null +++ b/examples/filtering_example/README.txt @@ -0,0 +1,2 @@ +Plotting Two Structures Inferred with Different Amounts of Filtering +==================================================================== diff --git a/examples/filtering_example/data/contact_counts.npy b/examples/filtering_example/data/contact_counts.npy new file mode 100644 index 00000000..8ae175bb Binary files /dev/null and b/examples/filtering_example/data/contact_counts.npy differ diff --git a/examples/filtering_example/data/struct_inferred_less.000.coords b/examples/filtering_example/data/struct_inferred_less.000.coords new file mode 100644 index 00000000..a52ab455 --- /dev/null +++ b/examples/filtering_example/data/struct_inferred_less.000.coords @@ -0,0 +1,283 @@ +-1.060105063866469077e+00 1.419638929768517688e+00 -2.503868644937799814e+00 +-1.185966052252924285e+00 1.406523974607325256e+00 -2.567475309585633525e+00 +-1.137051207052447888e+00 1.376874014874222230e+00 -2.602459637543611315e+00 +-1.091319894701067827e+00 1.362971928646565356e+00 -2.705809813972186895e+00 +-1.012291516612398024e+00 1.386021904887117628e+00 -2.734407597737004370e+00 +-1.088418181667881512e+00 1.439614629739466523e+00 -2.817035039657810103e+00 +-1.067280934749828880e+00 1.511526892296124247e+00 -2.834348159793492083e+00 +-1.103138928931108653e+00 1.610330465776673048e+00 -2.836780666353308611e+00 +-1.101465888453341702e+00 1.644772724620277904e+00 -2.752879766964355213e+00 +-9.788069704644227764e-01 1.641044658004799484e+00 -2.712813438018510936e+00 +-8.961800607933078089e-01 1.700787169481552175e+00 -2.736181679690213198e+00 +-9.296644545816805660e-01 1.842779417793523722e+00 -2.726331594125842805e+00 +-9.227828469405244816e-01 1.852804543216597599e+00 -2.864656053690336268e+00 +-8.502983633957895693e-01 1.862289724698344529e+00 -2.867325609679583831e+00 +-7.818744954934517821e-01 1.855510299131177598e+00 -2.835164089377887553e+00 +-7.126358625707620575e-01 1.860382469759098933e+00 -2.786225387289335664e+00 +-6.559111253825653520e-01 1.876729571171619870e+00 -2.713561727419344205e+00 +-5.870246176620348422e-01 1.969406977714849294e+00 -2.715844632833971151e+00 +-5.084486450502211374e-01 2.009822858390378997e+00 -2.672653364584794300e+00 +-4.066051640561303970e-01 2.034631453608488183e+00 -2.655870700585394317e+00 +-3.803741668277237920e-01 2.106298837338512087e+00 -2.708735065166673284e+00 +-2.982787040498443010e-01 2.084181377426364445e+00 -2.695781269696232663e+00 +-4.446212036330762229e-01 2.172092288829301499e+00 -2.544218661115961844e+00 +-3.947530924813270059e-01 2.238869755797198380e+00 -2.576130490945732099e+00 +-3.013853438382768646e-01 2.220851665518115414e+00 -2.591473914710706428e+00 +-2.895867640521230246e-01 2.157966367130839558e+00 -2.554807252166656273e+00 +-2.772625309898142376e-01 2.102079745607603023e+00 -2.454767383164327299e+00 +-2.486779600641030874e-01 2.124187098274361585e+00 -2.361154594594416789e+00 +-1.429570875678686237e-01 2.127687999817301723e+00 -2.379150428457621036e+00 +-1.052546706177688585e-01 2.096802474289472862e+00 -2.446202682841163156e+00 +-6.227995121567291709e-02 2.029227341276245156e+00 -2.422599823469696378e+00 +-7.569204110072355607e-02 1.947562440571213527e+00 -2.449581035146956687e+00 +-1.589580318210598864e-01 1.933123350868615198e+00 -2.406571720027572248e+00 +-1.723254000984085488e-01 1.965274338243175434e+00 -2.303533065485680265e+00 +-3.976955243034733384e-02 1.634844023846074634e+00 -2.028506664868295228e+00 +-5.655427007855885063e-02 1.599435153273379040e+00 -2.016749747185546227e+00 +-7.079473087156193389e-02 1.386816257098542282e+00 -1.890745232470370629e+00 +-5.768311901881584963e-02 1.286360843415731203e+00 -1.817233449976980442e+00 +-3.885107818441818628e-02 1.150338952517932389e+00 -1.714552899225382010e+00 +-1.684521575522759940e-02 1.054841575940727694e+00 -1.653846517355911372e+00 +1.381712501501609035e-02 9.495528094777306860e-01 -1.613077828560580684e+00 +7.895602256425847398e-02 8.274396136546469105e-01 -1.619567725101030087e+00 +9.313228086786064230e-02 7.600416832569938386e-01 -1.651136969506464602e+00 +4.699449543851050293e-02 5.858659563860217911e-01 -1.708578970482389270e+00 +1.663211556183403009e-02 4.811155909627511384e-01 -1.760280537746134355e+00 +1.268724612633164578e-02 4.577583844098483956e-01 -1.811950392134286103e+00 +-1.038857079537826161e-01 4.123521921669119350e-01 -1.496702717637034441e+00 +-1.316743479261661964e-01 4.241591942190687248e-01 -1.399996799971862327e+00 +-1.619802208863251047e-01 4.691099530863624412e-01 -1.272713175402228725e+00 +-1.621536712736829089e-01 5.308208139020692551e-01 -1.174195818113682233e+00 +-8.015547127720848430e-02 5.902440740834962174e-01 -1.059201526501925450e+00 +-1.803579187618166782e-02 5.950566648406850900e-01 -9.886924426044579883e-01 +7.643345433912633602e-02 5.716109916116162148e-01 -9.080089530452604141e-01 +1.625688601458441795e-01 5.435316337225770678e-01 -8.541426462882651949e-01 +3.436663056026237340e-01 5.527286618105712312e-01 -8.509485494817764506e-01 +4.375923983801056072e-01 5.032925671169679038e-01 -8.809231918243946025e-01 +5.025171718555936362e-01 4.350699920576783786e-01 -9.175075008856057313e-01 +5.630217165084032693e-01 3.159535187266901413e-01 -9.752152775139930618e-01 +5.830195834564997348e-01 2.056667280985729207e-01 -1.001084709590037480e+00 +5.978178720240250321e-01 9.872264444333699041e-02 -1.071179042876047705e+00 +5.581587201984916646e-01 -4.743467584225594027e-04 -1.155879412322852406e+00 +5.141117022800921754e-01 -8.720848952043068480e-02 -1.219411964978565299e+00 +4.373457671539222047e-01 -1.812121903718920402e-01 -1.263612542217528167e+00 +3.203441543920726997e-01 -2.848742196248354452e-01 -1.250661701081541732e+00 +2.296729209634381097e-01 -3.005842618633420282e-01 -1.156745711018260403e+00 +1.746893519945877382e-01 -3.116583796267983208e-01 -1.065127866165136217e+00 +1.508724136809393712e-01 -3.217786549951546782e-01 -9.389664659563528026e-01 +1.727223780603261427e-01 -3.383350529159434572e-01 -8.317345691483954973e-01 +nan nan nan +2.551350860045729640e-01 -1.599331526536308945e-01 -5.809150887126609542e-01 +4.584988098731316519e+00 -2.071594559040722316e+00 -4.521969444480724576e+00 +nan nan nan +-6.297703722507699831e-02 -1.262074426909685076e-01 -5.580067633924438164e-01 +-1.500013884351373838e-01 -1.292711796683704284e-01 -4.640756787208818457e-01 +-2.648197893371591061e-01 -1.747220133429770172e-01 -3.608469322107149546e-01 +-3.806777616686071730e-01 -2.133386298785816815e-01 -4.346394277833101616e-01 +-4.724178565271108243e-01 -2.301166118336840927e-01 -4.943862723384497837e-01 +-6.195353357760851054e-01 -1.856027081697714243e-01 -5.973286555790279229e-01 +-6.565969791453908355e-01 -2.522435212959162620e-01 -6.720579894311671243e-01 +-6.906304160527581004e-01 -3.248982581102538569e-01 -7.558632793844376474e-01 +-7.218263527401105328e-01 -3.930548757497235313e-01 -8.905286073204179420e-01 +-7.305322339090279948e-01 -4.964248110390021007e-01 -1.005748300984708354e+00 +-6.700650770648884924e-01 -5.942220116328359447e-01 -1.049489174864209007e+00 +-6.057110234255167480e-01 -6.628272046074712431e-01 -1.060865497728608720e+00 +-4.954373066336786313e-01 -7.579861358890397360e-01 -1.025778986420884387e+00 +-4.275040595734925786e-01 -8.263628162061352755e-01 -9.930675168804117270e-01 +-3.734925542805736520e-01 -9.079539920883741289e-01 -9.328817621761027468e-01 +-3.533563846697493904e-01 -9.910876795059948563e-01 -8.428394295291459226e-01 +-5.507230941810643543e-01 -1.146489463790352437e+00 -7.243409888863640012e-01 +-6.736342147737298669e-01 -1.183057481056691618e+00 -6.849936318171857552e-01 +-7.410500086051954316e-01 -1.206107243571919785e+00 -6.157818365277838435e-01 +-7.001190346734902370e-01 -1.135789485208071659e+00 -4.415958127596205096e-01 +-6.336913297183119909e-01 -1.119493635491834782e+00 -2.879904617214636975e-01 +-5.772488194637910297e-01 -1.116217551120360030e+00 -2.061885409121553270e-01 +-4.529504159031707555e-01 -1.144367176678506848e+00 -1.042268905632246639e-01 +-2.994549652681413043e-01 -1.204671844661169944e+00 -6.516689981644288587e-02 +-2.236472463691959733e-01 -1.342198966478463484e+00 -8.437779566965626643e-02 +-1.961799505807501898e-01 -1.463382923788420165e+00 -1.182432268990656066e-01 +-2.594095111625690508e-01 -1.606858541971862842e+00 -1.369174097423450642e-01 +-2.636812875014058477e-01 -1.661368957501337507e+00 -2.458904132743678916e-01 +-2.276161042382852662e-01 -1.707143976526336093e+00 -3.606428928542497747e-01 +-1.702527587642086726e-01 -1.696376126263388295e+00 -4.428817550827101046e-01 +2.287897128922251541e-02 -1.562743883662984334e+00 -5.150725973429055582e-01 +1.296739287541401608e-01 -1.631626484893829776e+00 -5.497874134813317548e-01 +2.411974121520635006e-01 -1.715156055526157131e+00 -5.410026771007425683e-01 +1.126802105097722384e+00 -8.726930787153014180e+00 -1.777020109782051938e+00 +3.752268338336220976e-01 -2.076905210422906656e+00 -3.030208535016294391e-01 +3.946531401932798500e-01 -1.883840239308030684e+00 -2.035325111345757665e-01 +4.717299743864118988e-01 -1.759914219219153475e+00 -1.204533642539053484e-01 +5.515659303585953577e-01 -1.666781837291901214e+00 -9.396541416209991393e-02 +6.392310199114037417e-01 -1.587111187274750757e+00 -1.654351128253502556e-01 +7.136606804862767328e-01 -1.540130633005070582e+00 -2.699536263724990337e-01 +7.797448075392801048e-01 -1.506134156516633960e+00 -3.972407346879681111e-01 +8.134468328788372338e-01 -1.451317970950333436e+00 -4.685584713513679112e-01 +8.105052235528004134e-01 -1.316711312345403062e+00 -5.192250157188658122e-01 +7.836691340537106365e-01 -1.211857180180576865e+00 -5.299221633638473428e-01 +7.222040941071938835e-01 -1.066024534545122693e+00 -4.694418864120384893e-01 +6.544278653881583363e-01 -9.905915047245785754e-01 -2.414126121040359174e-01 +7.068326984082179409e-01 -9.241290045753208782e-01 -2.392860565453047428e-01 +8.037216162673672670e-01 -7.943997266926831058e-01 -1.780784133421523807e-01 +9.188972156407326786e-01 -7.563111338376227177e-01 -2.542614568664787744e-01 +1.033491815566265792e+00 -7.424456068613227711e-01 -2.671296864352985523e-01 +1.174466602011370764e+00 -7.623273265388492703e-01 -2.819485747932679032e-01 +1.285069115095078596e+00 -8.188062171467089811e-01 -2.685871957447376612e-01 +1.380979027773302059e+00 -8.741520184299075291e-01 -2.530404310189395267e-01 +1.469157094875339187e+00 -9.416267249127185934e-01 -2.206737845050733837e-01 +1.573133719303099642e+00 -1.049821446235890576e+00 -1.573465843151898302e-01 +1.595364417467326712e+00 -1.120371165099053545e+00 -1.036994374863194623e-01 +1.542774271354963922e+00 -1.234812281444744198e+00 1.620359463325689656e-02 +1.442984021627761848e+00 -1.367540345611533370e+00 1.994654361726083958e-01 +1.387795748631571069e+00 -1.420446846545027730e+00 2.175430778814558819e-01 +1.326124246654587280e+00 -1.397325392893097318e+00 4.388376560251212588e-01 +1.200191424837275367e+00 -1.335650299973220712e+00 4.541733666195255092e-01 +1.092264062231115052e+00 -1.258534848825845209e+00 4.682917538910168487e-01 +1.010784827770486283e+00 -1.169757669107219566e+00 4.690782503712445650e-01 +1.070477832715446054e+00 -1.015759555150710147e+00 5.013464428702361086e-01 +1.167194639586382365e+00 -9.141195629392049327e-01 5.548510201648217954e-01 +1.283184521807257283e+00 -8.868221307892810712e-01 6.225022015177958945e-01 +1.398785801443611643e+00 -8.707629539259774676e-01 6.916543177137095544e-01 +1.567732509263051188e+00 -8.220409842326232841e-01 7.507303524816090201e-01 +1.638605154761292981e+00 -8.035054326995910712e-01 7.664759981147674095e-01 +1.166450125827302031e+01 -1.413883084323245942e+00 3.534583284676486414e+00 +1.917665706145000204e+00 -3.802277242016984804e-01 6.174105515139156619e-01 +1.579900042708726415e+00 -4.493569110692862134e-01 5.142440228139313341e-01 +1.481989681719573904e+00 -3.248048632913721478e-01 5.727154718895802743e-01 +1.448527630983195147e+00 -2.529460664373324730e-01 6.425337957722953020e-01 +1.372006226223666747e+00 -1.647961354639661258e-01 7.250787805894040039e-01 +1.328254088243564279e+00 -6.980093656292900295e-02 7.799561742905368744e-01 +1.187885341819834961e+00 -7.746332645236893300e-02 6.540232193073186595e-01 +1.077704176702966699e+00 -3.732784102082607053e-02 5.795190657221575004e-01 +9.872777889955641761e-01 -8.797351788349777602e-02 5.196778574684468577e-01 +8.917772497733045256e-01 -1.129095062784703785e-01 5.085069300809813564e-01 +7.802357322652724303e-01 -1.676877353568469176e-01 5.018852761972253385e-01 +6.090519198805177670e-01 -2.706131222667023661e-01 5.051921402151651197e-01 +5.185874462151635056e-01 -3.448342226527232324e-01 5.903484151975479932e-01 +5.627313645340448200e-01 -4.833669488032419914e-01 5.812004371738300756e-01 +nan nan nan +4.890327853368135469e-01 -6.152037644210596179e-01 8.316106682497398372e-01 +5.396965538107977300e-01 -5.736187998608136551e-01 9.068618463922790696e-01 +5.614829540108587924e-01 -5.002686125911230963e-01 1.016164538046750776e+00 +5.209717977321074445e-01 -4.415753139795929316e-01 1.129677051914892871e+00 +7.150652661634203655e-01 -2.816638319699533710e-01 1.140294326082697429e+00 +7.709282217564895623e-01 -2.925039063524250138e-01 1.279108078587716690e+00 +8.384259216292627714e-01 -3.515497444595744314e-01 1.375052609408949467e+00 +8.984218788992829330e-01 -4.558166965127801173e-01 1.450057143030758500e+00 +9.250052190182000977e-01 -5.690366823909343008e-01 1.477420660720647039e+00 +9.393059408005598465e-01 -6.960235101422141968e-01 1.491903065971603937e+00 +9.242907306638052933e-01 -8.199140885684386149e-01 1.507430234329109275e+00 +8.862610910248072127e-01 -9.371747523629486709e-01 1.530634183605114940e+00 +8.221074599528409577e-01 -1.034912139381248375e+00 1.564855192250162785e+00 +7.438011100198999026e-01 -1.101614704567763114e+00 1.589257784209407998e+00 +6.165155197115115282e-01 -1.151999245146119399e+00 1.602986785600869712e+00 +5.257314531872837593e-01 -1.149621046135516966e+00 1.576577253330419426e+00 +4.041616615396876333e-01 -1.122536856455495613e+00 1.505014219913169526e+00 +3.323809268317176602e-01 -1.109914930646543230e+00 1.400240893093980921e+00 +2.987172910039978535e-01 -1.106564391785828327e+00 1.251129408146993027e+00 +3.253222096849622824e-01 -1.171371235209884176e+00 1.129813963144879363e+00 +3.453859849478626565e-01 -1.280426772638798338e+00 1.074478825388354375e+00 +3.514606782700429033e-01 -1.408472588413241633e+00 1.028530090491389215e+00 +3.138499497366391555e-01 -1.564580320126128798e+00 1.058888867490950902e+00 +2.238134234463096395e-01 -1.630982071610207917e+00 1.047757097334427234e+00 +1.182742184265950097e-01 -1.647353339597295685e+00 1.016806381725585240e+00 +-7.046645003024769489e-03 -1.629856835807122817e+00 9.593210369482034761e-01 +-8.492523562392632897e-02 -1.596209466069691940e+00 8.657486993627242500e-01 +-9.517930669951592260e-02 -1.493207232361669412e+00 7.001578861006856336e-01 +-3.551345742736051747e-01 -1.527603343446163331e+00 7.177118281490599827e-01 +-3.025862495621814974e-01 -1.440798585264913223e+00 6.697964423397553269e-01 +-3.661088155111451581e-01 -1.309158177163253889e+00 5.937558202708612676e-01 +-4.833865041546633323e-01 -1.197890853031175151e+00 5.564731004435964357e-01 +-5.968234093486290970e-01 -1.148195835756678163e+00 6.154502864569691978e-01 +-7.059184408729330951e-01 -1.119128466873791306e+00 6.753552501778782302e-01 +-8.253504214330064093e-01 -1.118759573045263522e+00 7.956126559870585480e-01 +-8.833556462825472577e-01 -1.134988635836977622e+00 8.953977536614522448e-01 +-8.783283597163222822e-01 -1.164553870886468445e+00 1.038129210198725838e+00 +-8.090541501331733887e-01 -1.180981855761979338e+00 1.157556230348058435e+00 +-7.448071004020376806e-01 -1.169602029719726044e+00 1.266669276549012402e+00 +-6.944379121185664250e-01 -1.137551738103624865e+00 1.366284415587835754e+00 +-6.513006990373674254e-01 -1.088612416279895356e+00 1.441695167604668981e+00 +-6.069291018302346297e-01 -9.643696751574536430e-01 1.527093295950918472e+00 +-5.850765250534361028e-01 -8.358688725162658484e-01 1.593695415290528494e+00 +-5.593806183346566874e-01 -7.704635881825773192e-01 1.621344836521536825e+00 +nan nan nan +-7.914197559562415885e-01 -5.630643007303453018e-01 1.341921091982620551e+00 +-8.842875918729764528e-01 -5.504965128681408304e-01 1.301893939702279956e+00 +-9.939345994792463390e-01 -5.265863900550860066e-01 1.239184963274625462e+00 +-1.094096269315149028e+00 -4.971992558699794285e-01 1.158113197398657590e+00 +-1.204856883304301851e+00 -4.557428921533284716e-01 1.069002565664562532e+00 +-1.251839380296877247e+00 -4.213013429662496034e-01 9.998817887154219930e-01 +nan nan nan +nan nan nan +nan nan nan +nan nan nan +nan nan nan +nan nan nan +nan nan nan +-1.280421358003977161e+00 -3.604120239692830685e-01 8.744308965158998914e-01 +-1.262762898240429310e+00 -3.326953935599847867e-01 8.250022592310438663e-01 +-9.144153244045100104e-01 -2.848353580887465486e-01 7.319476612798279103e-01 +-8.362608394631356745e-01 -1.961919841448874768e-01 7.400128659364501038e-01 +-7.792615374335327694e-01 -1.124780741554758795e-01 7.505321157453805903e-01 +-2.661428479157588178e+00 -1.090102152367495414e+00 5.333790805171300775e+00 +-4.103600513022199192e-01 -1.801974062514635488e-01 9.361294558849418967e-01 +-3.900212397636502737e-01 -9.757331402650314123e-02 1.026288068469481951e+00 +-3.426552209663634718e-01 -2.228765222428041176e-02 1.110294787239049841e+00 +-2.823856304553922780e-01 1.222300792784839461e-02 1.184575130171286350e+00 +-2.300947233156002691e-01 3.029658639827070149e-02 1.268406667802079335e+00 +-1.926230226760298758e-01 5.271223090899017361e-02 1.404913547900600523e+00 +-1.788929067700576747e-01 5.327589943756965568e-02 1.541989280043919219e+00 +-2.607703465985978242e-01 7.597271844454005219e-02 1.659165824987996141e+00 +-3.402421337851824212e-01 1.290690586010013186e-01 1.723352728218610519e+00 +-4.158891525126219846e-01 1.881008875431754990e-01 1.767800527966260526e+00 +-5.248502014978564389e-01 2.982732639896046312e-01 1.774830585772320779e+00 +-5.771310986959272693e-01 3.514184226535445599e-01 1.749718781257656453e+00 +-6.770992370623319934e-01 4.140513549109863800e-01 1.648327099597339140e+00 +-7.897807105596109656e-01 4.127755378416356757e-01 1.596099376060298836e+00 +-8.976950906095068072e-01 3.752196470445666177e-01 1.549296938787325884e+00 +-1.010811624072138093e+00 3.624847034297525861e-01 1.496022781708529426e+00 +-1.085627452853177077e+00 3.812111988795388595e-01 1.440130953393476076e+00 +-1.254267938185354314e+00 5.941702100349945947e-01 1.326405019111386308e+00 +-1.212700674437489079e+00 5.911063933932680925e-01 1.281207322740652854e+00 +-1.093733993899454138e+00 6.200897247329605344e-01 1.192585182868716176e+00 +-9.895865038076065989e-01 6.613885523001736821e-01 1.133268972025751165e+00 +-8.944126557143532441e-01 7.013253861827608571e-01 1.071336861929242046e+00 +-8.271178348580688899e-01 7.220002683545225786e-01 1.002694896853671747e+00 +-8.650420608400314348e-01 7.285246803048130992e-01 8.104499534882282363e-01 +-7.888584067799856436e-01 7.237086553326773641e-01 7.143178282557925973e-01 +-7.230848352099447096e-01 6.960799493506613089e-01 6.641556375551750380e-01 +-6.333664329214973021e-01 6.465913434851020547e-01 6.331517369021065766e-01 +nan nan nan +-3.638298749280313160e-01 5.774029215061929898e-01 7.519008864915509571e-01 +-3.370346627129136019e-01 6.776952872075672207e-01 8.439551723613889500e-01 +-2.161540320064516962e-01 7.573076221145906839e-01 1.011566123147175977e+00 +-1.693587842629479256e-01 8.324439060848766170e-01 9.717807944788746655e-01 +-9.346815326135844704e-02 8.702958816351806792e-01 8.466199164228130902e-01 +nan nan nan +-2.366645865222849476e-01 1.068114587364830337e+00 7.057107709054831757e-01 +-6.580400946770617598e-02 1.205786466882531771e+00 6.655475389047402768e-01 +-8.656594846033626167e-01 7.951145780897300952e+00 5.945319535998381255e+00 +nan nan nan +-2.402722755120627884e-01 1.366886891425368011e+00 9.170168299455691008e-01 +-2.257181641063496780e-01 1.490757723610329544e+00 9.205097218688711447e-01 +-1.806938182958154615e-01 1.810902542396287451e+00 1.006403274041429929e+00 +-1.211620843089817878e-01 1.905078614921198454e+00 1.015142263727350835e+00 +-1.734597598842200494e-01 1.958042593728377634e+00 1.044915634465598098e+00 +-1.418802814477223839e-01 2.012132333665561212e+00 1.077121117661140159e+00 +-1.313967631496093524e-01 1.993123947312734012e+00 1.129647331091709672e+00 +-8.282105816454987668e-02 1.958424672862919103e+00 1.165710890316810522e+00 +8.368671219930767444e-03 1.842163912010556182e+00 1.285644675989303876e+00 +-1.064405840745457146e-02 1.867671799945773703e+00 1.417497251468139430e+00 +4.312109556987315379e-02 1.884497774532874592e+00 1.457627447151763400e+00 +1.580293408629517560e-01 1.884006643366772149e+00 1.447686813233409309e+00 +2.316774526190330252e-01 1.840519213980586821e+00 1.453306422043247004e+00 +2.990849610545172066e-01 1.799257871540277831e+00 1.454440260786652672e+00 +nan nan nan +2.229168159708218855e-01 1.593992184212281282e+00 1.437682758861623000e+00 +3.678126436373534425e-01 1.665882044591418865e+00 1.556155454140409011e+00 +3.136863090325622272e-01 1.568730475813248537e+00 1.568396582415493512e+00 +3.187566202473148258e-01 1.560876378842728451e+00 1.646941765442482941e+00 +2.600593021373386327e-01 1.523968715895106074e+00 1.704399924449465642e+00 +nan nan nan +1.899922696541346545e-01 1.607991248518133576e+00 1.820076476815319477e+00 +2.080807504130959551e-01 1.654894821583411613e+00 1.877616342512795189e+00 +2.272244617840094849e-01 1.692052134814174602e+00 1.902189728024550330e+00 diff --git a/examples/filtering_example/data/struct_inferred_more.000.coords b/examples/filtering_example/data/struct_inferred_more.000.coords new file mode 100644 index 00000000..ba6c1d84 --- /dev/null +++ b/examples/filtering_example/data/struct_inferred_more.000.coords @@ -0,0 +1,283 @@ +3.969562820189117408e-03 1.627204272622619019e+00 -2.655699336760933171e+00 +8.865611478091407413e-03 1.590921291231113477e+00 -2.791565487145597491e+00 +6.858626844182506843e-02 1.613801317955039449e+00 -2.767173988560990949e+00 +1.522154266817122847e-01 1.688864017558873609e+00 -2.791185331614133069e+00 +1.627031393443690022e-01 1.758940346880310868e+00 -2.742637084735925601e+00 +1.543456665718529186e-01 1.806952978907074403e+00 -2.851441694642477653e+00 +1.252906041610380716e-01 1.875167174519441371e+00 -2.848550406565983462e+00 +3.901670465597480153e-02 1.911454964696406966e+00 -2.858381223502992619e+00 +nan nan nan +4.942141600865265771e-02 1.955038670258459232e+00 -2.696204415045326819e+00 +-1.255593271452314433e-02 2.028433539142452169e+00 -2.682533750353500501e+00 +-1.440957952650939455e-01 2.038212816302503949e+00 -2.741845440972275227e+00 +-9.648925153056103765e-02 2.138094387792328188e+00 -2.829152601476537576e+00 +-1.044657899209691793e-01 2.195717826340948697e+00 -2.782169719805482444e+00 +-1.130780113487419997e-01 2.220096601357270938e+00 -2.709682531846182130e+00 +-1.340135083678243022e-01 2.238364140739175223e+00 -2.628911418561245661e+00 +-1.570186842270494820e-01 2.238422123682817233e+00 -2.536778696572036917e+00 +-2.098217428101630255e-01 2.334564323821003651e+00 -2.494237020210787747e+00 +-2.467426267014742602e-01 2.376064644420369909e+00 -2.410892744995131398e+00 +-2.535394296225885746e-01 2.432828931883892487e+00 -2.319673838921997078e+00 +-2.674092671963768653e-01 2.524466554592892376e+00 -2.334624825051543340e+00 +-2.364130475753326299e-01 2.539924676902465261e+00 -2.253315955293026196e+00 +-4.321605765986450964e-01 2.433149581024615760e+00 -2.309197545908876048e+00 +-4.547938846280092373e-01 2.517471131201678869e+00 -2.297979238058800888e+00 +-4.116789090937457152e-01 2.566767562306456529e+00 -2.227734055192503337e+00 +-3.798481676455033873e-01 2.517873294874855450e+00 -2.182051883139178639e+00 +-3.970447561797872948e-01 2.425930664602560682e+00 -2.112413022995150325e+00 +-4.669695374258981402e-01 2.386976107351304055e+00 -2.052073604270346685e+00 +-4.453000363454154842e-01 2.447072082660403325e+00 -1.963735754424252633e+00 +-3.726476151870758424e-01 2.488291144513705699e+00 -1.954834091969238408e+00 +-3.231814840577681425e-01 2.450521090410829217e+00 -1.897299846036455628e+00 +-2.497227677506553556e-01 2.406789257373494362e+00 -1.912850316640140935e+00 +-2.826165523629389220e-01 2.330844345534188289e+00 -1.958082196040032752e+00 +-3.754220376606326459e-01 2.282212575452730263e+00 -1.924750740837053664e+00 +nan nan nan +-2.229388138352060567e-01 1.827818866878687443e+00 -1.644471475496952939e+00 +-1.891619067464682669e-01 1.685088842829634004e+00 -1.558305013808299222e+00 +-1.634124949230743862e-01 1.583845109399838469e+00 -1.495801381228440752e+00 +-1.255610575085277791e-01 1.447138851201981380e+00 -1.410188831521486774e+00 +-1.079514338172918447e-01 1.352222633922150141e+00 -1.351873771317295914e+00 +-1.085728712462674245e-01 1.251697453250777858e+00 -1.294191490703072933e+00 +-1.717882156190602139e-01 1.146969481795434564e+00 -1.235396437128123859e+00 +-2.030299594095788529e-01 1.082157887075222868e+00 -1.223847268959062040e+00 +-1.757750874862806234e-01 9.140641864989741405e-01 -1.194652089334782952e+00 +-1.298759785983560899e-01 8.263379370388194145e-01 -1.185664887354547004e+00 +nan nan nan +7.489260400603407752e-02 7.307204548680459322e-01 -1.274510006825848585e+00 +1.727815193136366112e-01 7.440702394965925670e-01 -1.265848932983446584e+00 +2.892320609379387397e-01 8.032805699280497480e-01 -1.208675867687311722e+00 +3.343001166084904607e-01 8.628297984352989447e-01 -1.117736405791359910e+00 +3.301027974085333216e-01 9.083387339803702387e-01 -9.641682573171690418e-01 +3.354439050831759528e-01 8.936520900994356920e-01 -8.685876436700089576e-01 +3.616268540912416229e-01 8.392387580589801832e-01 -7.539042096573279617e-01 +4.198371104766217554e-01 7.864142219997081185e-01 -6.830512515227801229e-01 +6.021526964555291572e-01 7.639743820513879013e-01 -6.444643026125481677e-01 +7.023052551050551484e-01 7.231658674979444257e-01 -6.732364971909013951e-01 +7.743730034905182968e-01 6.722529528546196120e-01 -7.237672345341047420e-01 +8.411936760891821629e-01 5.884169106609953293e-01 -8.276828712195796189e-01 +8.784284116646678964e-01 5.075072387884247416e-01 -9.006549967733828987e-01 +8.849173837860108138e-01 4.278032349689949165e-01 -1.004400427378420169e+00 +8.487971483550329488e-01 3.458545677268027863e-01 -1.108507360179187051e+00 +8.114394411893123271e-01 2.610803050438326167e-01 -1.182379690595190658e+00 +7.432796187075232375e-01 1.596097366643351723e-01 -1.233329804000105279e+00 +6.519273948227225501e-01 3.317955852698359354e-02 -1.196888043491323605e+00 +5.858595297784895406e-01 2.883547586024641333e-03 -1.083859250841935351e+00 +5.346987292844951334e-01 -1.382833741637966816e-02 -9.896524004805729025e-01 +4.991313900308490537e-01 -2.658262484949099752e-02 -8.666466369289458349e-01 +4.967031232220214254e-01 -4.236080560590543137e-02 -7.582579795393910027e-01 +nan nan nan +3.781367560362130509e-01 9.502790305855980668e-02 -5.095189937392489155e-01 +nan nan nan +nan nan nan +8.760167420709930042e-02 1.913388969877986498e-02 -6.276542085065778265e-01 +-3.608356750722264972e-02 2.442801227762022090e-02 -5.924275810475939652e-01 +-1.813637356074720153e-01 -2.828457825038479742e-02 -5.531305849877258263e-01 +-2.470366679079794847e-01 -9.645125850012438440e-02 -6.560312301632715837e-01 +-3.077158731876467601e-01 -1.368960555804115131e-01 -7.396895533624269214e-01 +-3.840164440382490274e-01 -1.473503834811499547e-01 -9.067056002537846604e-01 +-3.647669739271006129e-01 -2.136796661982417467e-01 -9.867400106038418661e-01 +-3.316241039689339920e-01 -2.867956838542425890e-01 -1.073233920545559883e+00 +-2.852718450792400828e-01 -3.521811216681463019e-01 -1.205329355167819916e+00 +-2.373087215822177187e-01 -4.377746590857159448e-01 -1.322761132429549180e+00 +-1.533154520129803577e-01 -5.189493183343341087e-01 -1.360124705842473469e+00 +-7.679909528815133390e-02 -5.719749061555007286e-01 -1.359941035384673258e+00 +4.613127652918880273e-02 -6.406978836032157787e-01 -1.305228561378299679e+00 +1.273696722123802971e-01 -6.865267465931699231e-01 -1.256045150805345623e+00 +1.952285524337246947e-01 -7.357261929410596757e-01 -1.174312494981977206e+00 +2.388086705094945306e-01 -7.677652778117546317e-01 -1.062554999211848816e+00 +1.967383829041066956e-01 -7.623199706362246975e-01 -7.865611743164594438e-01 +9.296692493045019545e-02 -8.132418541673938073e-01 -7.634331012375286107e-01 +nan nan nan +-9.754239177708731723e-02 -9.153541568867713529e-01 -6.731910884982891252e-01 +-1.820603645088527955e-01 -1.047082021035522281e+00 -6.525237574744042757e-01 +-2.046220198489036302e-01 -1.137266319653614355e+00 -6.225649408389822836e-01 +-1.662073726272982888e-01 -1.278620317540666074e+00 -5.614929191346503812e-01 +-6.985310120267201883e-02 -1.410737542853226056e+00 -5.412781877061780822e-01 +4.562639506665232270e-02 -1.504046768094582598e+00 -5.994162560328675227e-01 +1.344126668837257177e-01 -1.556471920542550569e+00 -6.805963688556924129e-01 +2.671330028984341132e-01 -1.583203687476885113e+00 -7.382220825136176501e-01 +3.761888329274660214e-01 -1.592599551893780774e+00 -6.913105854296173192e-01 +4.746336544935328416e-01 -1.586717377096257264e+00 -6.077650046999876210e-01 +5.145371333085454468e-01 -1.552658095775147684e+00 -5.241805103392523923e-01 +5.024135170219732327e-01 -1.383224488557243337e+00 -3.596460431972606786e-01 +5.278041171052745284e-01 -1.263174415091138147e+00 -3.099205825144354387e-01 +5.830958037481315248e-01 -1.149789336045133670e+00 -2.828185408817908142e-01 +nan nan nan +7.263722890311951064e-01 -9.644001903772437823e-01 -4.360532108472542911e-01 +8.416388282762257145e-01 -1.018174768668130392e+00 -4.974973706443410193e-01 +9.839686187736925715e-01 -1.075827670228772570e+00 -5.506432491672246243e-01 +1.085202963078263583e+00 -1.150502480628080360e+00 -5.462017740476893257e-01 +1.148839538528731996e+00 -1.259825222547477530e+00 -4.913138155112851124e-01 +1.188807874267560072e+00 -1.362423187314900863e+00 -4.068218467124288806e-01 +1.218592093233051621e+00 -1.443492086660176810e+00 -2.800608465309319395e-01 +1.239876422028424408e+00 -1.460821160429782495e+00 -1.851248985763986055e-01 +1.263703122015958247e+00 -1.401820394624030186e+00 -5.099175943584076387e-02 +1.285150987670576672e+00 -1.331984377839679379e+00 3.097020880366738865e-02 +1.316644366658124454e+00 -1.168883076302228874e+00 8.162900543002886422e-02 +1.593765597076224561e+00 -1.149333873654721172e+00 5.478591720987185248e-02 +1.588943830678825275e+00 -1.065889124958856016e+00 7.247714071564494154e-02 +1.571149289985903641e+00 -8.973076326058098129e-01 1.234367744752716128e-01 +1.610529091922178191e+00 -7.991402458770090478e-01 2.628169910744742460e-02 +1.589865099365992629e+00 -6.890876176458408109e-01 2.870769555660990756e-03 +1.527480836701860412e+00 -5.650682362222728683e-01 -3.284461036070942391e-02 +1.428229207742119033e+00 -4.878373206155469655e-01 -4.168085901466109244e-02 +1.328626009184103118e+00 -4.365447599945171953e-01 -4.068541162543198864e-02 +1.218439725812340724e+00 -4.164955714221543759e-01 -2.287303224168678664e-02 +1.088110739428559626e+00 -4.321327836646669529e-01 1.109200911913655122e-02 +nan nan nan +8.520323620312929558e-01 -5.113978842891532262e-01 1.054193847286154090e-01 +7.341743366321497044e-01 -5.426773782365499343e-01 2.642533528922608177e-01 +6.576937664343620593e-01 -5.313281128107396611e-01 2.794311270150774407e-01 +7.110205161858581535e-01 -4.126275685258744552e-01 4.760175033439033032e-01 +7.098209047563917018e-01 -2.658938421765299487e-01 4.570583134271327119e-01 +7.615105731925210231e-01 -1.412051088310875002e-01 4.675235829540233534e-01 +8.034516422488330312e-01 -3.259753688774292418e-02 4.839784534761229495e-01 +9.598063496323704369e-01 -3.698056174443524469e-02 5.310290612083667927e-01 +1.087615200037423291e+00 -4.640965061345338205e-02 6.001244185281907617e-01 +1.205245644507302094e+00 -1.000573836890063101e-01 6.377423468727526634e-01 +1.293204697892523125e+00 -1.372452875031402175e-01 7.298284600595209559e-01 +1.414016255701031621e+00 -1.210208391804742240e-01 8.571281293950736568e-01 +1.470098749350251088e+00 -1.210669590944471602e-01 9.039758600013934053e-01 +nan nan nan +9.108168094562832939e-01 -2.881493276318551899e-01 1.020462981844594053e+00 +1.075884132231047507e+00 -2.260624746034413102e-01 1.136608641285096644e+00 +1.158606188813064319e+00 -3.585272139102506639e-01 1.213792658262818458e+00 +1.186216400557482231e+00 -4.432683645522097482e-01 1.268358642867816855e+00 +1.227562401955585747e+00 -5.745134416127118948e-01 1.310018789517634064e+00 +1.225970983007973469e+00 -6.750423070165325612e-01 1.370653993495059231e+00 +1.286785158450536537e+00 -7.736609247414564239e-01 1.212229631411687603e+00 +1.285895553686574821e+00 -8.879065418037181967e-01 1.128784133797407385e+00 +1.232978098434932779e+00 -9.551588358908124077e-01 1.039882333488521882e+00 +1.148410760430495614e+00 -9.841331631241940769e-01 9.853907586264528673e-01 +1.032869623766289768e+00 -9.909429012723696140e-01 9.287411628787488604e-01 +8.371534433944590736e-01 -9.408826137347927610e-01 8.666980409292801557e-01 +7.034327370526932688e-01 -9.857354469581252054e-01 9.119794841954602660e-01 +6.067937552238322763e-01 -8.980306887492818246e-01 8.602264924269322766e-01 +nan nan nan +3.975710744817899100e-01 -6.923675215697207008e-01 1.053160582785859445e+00 +3.850636905691111611e-01 -7.547404993715726151e-01 1.128643823120215384e+00 +3.563850266606228834e-01 -8.547494523244665299e-01 1.216627277294588527e+00 +3.094786684187004755e-01 -9.544516970996926863e-01 1.288818942584824656e+00 +4.897712619791151911e-01 -8.829288629546553357e-01 1.474500732511771162e+00 +4.836221705529471504e-01 -1.013106609221661403e+00 1.549484789087127057e+00 +5.006341913292090551e-01 -1.139528412856211315e+00 1.579241248165320854e+00 +5.209830524859588863e-01 -1.279642028344864624e+00 1.570980918371326807e+00 +5.421031154727999901e-01 -1.389884191680926584e+00 1.532943988204449548e+00 +5.806758235751295905e-01 -1.499375970371628730e+00 1.475189335246504863e+00 +6.247909232705137761e-01 -1.595348007306044646e+00 1.400303114070182264e+00 +6.595034524956181476e-01 -1.685640291678882408e+00 1.314202101125572897e+00 +6.849929752663558302e-01 -1.759756271818527562e+00 1.213893582599036014e+00 +6.896436745645091460e-01 -1.805485440424639432e+00 1.113842247816546172e+00 +6.637204155428786390e-01 -1.832651120184443316e+00 9.733035540775901717e-01 +6.123374226518970564e-01 -1.807433645245219100e+00 8.945548946005151825e-01 +5.176719287446335249e-01 -1.734783161264951135e+00 8.076102187278347833e-01 +4.238359299517291956e-01 -1.656875432198917197e+00 7.625461302500996519e-01 +3.025508884342451577e-01 -1.554239010977549462e+00 7.762303288750516117e-01 +1.773130377172660310e-01 -1.512551412467674439e+00 8.224541918596760537e-01 +5.997306940199997188e-02 -1.539369123255484251e+00 8.639208224781849133e-01 +-6.669474937226732569e-02 -1.592950959343388595e+00 8.912797343519953674e-01 +-1.432616136209978464e-01 -1.746544127839886773e+00 8.904251310182254020e-01 +-1.794603648961540510e-01 -1.821980275431198226e+00 8.100555146603432011e-01 +-1.948588580532292225e-01 -1.865542785459298081e+00 7.038658382323255136e-01 +-1.950558022780403689e-01 -1.887039341900125899e+00 5.564769198695586061e-01 +-1.998631358199751962e-01 -1.862280859199055394e+00 4.291785808143618319e-01 +-1.408034982183310746e-01 -1.802795255306791189e+00 2.547562592019888550e-01 +-1.532751176700334894e-01 -1.553688571264870033e+00 2.417204024219712644e-01 +-2.255356942007230303e-01 -1.607938427858069064e+00 1.788169888356661852e-01 +-3.323701525710466842e-01 -1.518632946529765659e+00 8.688044720568391388e-02 +-4.608477440392600988e-01 -1.430441059263620751e+00 2.864122474812011779e-02 +-5.880519234423224884e-01 -1.385159042850148570e+00 6.079313550599146909e-02 +-7.059768340875520742e-01 -1.349785890532591015e+00 9.258103053307070729e-02 +-8.588226726340906225e-01 -1.330967765270328007e+00 1.684979660954581682e-01 +-9.496396861879655704e-01 -1.333184620548026666e+00 2.402511071561149458e-01 +-1.017715722865954353e+00 -1.349231226786899995e+00 3.678116242848459283e-01 +-1.026503059017093378e+00 -1.373266345498578733e+00 5.049022570374361862e-01 +-1.018996597615294153e+00 -1.372189978919519104e+00 6.355722756264148288e-01 +-1.002570705459522538e+00 -1.348101184475512193e+00 7.524096322344102639e-01 +-9.718870273648816394e-01 -1.308302523103380910e+00 8.397800262616857969e-01 +-8.857303394258736473e-01 -1.208613041349275052e+00 9.296350359933917007e-01 +-7.909167458914387883e-01 -1.115557766069483536e+00 9.877119463661655496e-01 +-7.343449304959147605e-01 -1.071961988821559020e+00 1.015805469410062223e+00 +nan nan nan +-6.532602846290295195e-01 -7.661047077244961256e-01 6.598919348550416064e-01 +-7.444109542257667522e-01 -7.442153050964451788e-01 6.172483975785774124e-01 +-8.581414786225982638e-01 -7.095325723774557058e-01 5.564850875368614336e-01 +-9.662273182799472337e-01 -6.708164709391909453e-01 4.840085981572264107e-01 +-1.078913381511973579e+00 -6.158982152497506357e-01 4.033592006576915412e-01 +-1.133854476765585373e+00 -5.659799543971424374e-01 3.538213144710328772e-01 +nan nan nan +nan nan nan +nan nan nan +nan nan nan +nan nan nan +nan nan nan +nan nan nan +-1.192250357706018393e+00 -4.571300262299194950e-01 2.751157742128668149e-01 +-1.195419595866366702e+00 -3.989971350022197272e-01 2.590620589537421248e-01 +-7.990857175715004868e-01 -2.580802897970073118e-01 3.593829035941514261e-01 +-7.856916353453310409e-01 -1.952866145411724375e-01 4.589122520971352648e-01 +-7.786326954227329455e-01 -1.519859237287323195e-01 5.446121982062003264e-01 +nan nan nan +-1.095928059183183700e+00 -1.180301199019108821e-01 7.902965171478030237e-01 +-1.186535623757507985e+00 -1.219353316376525220e-01 8.729139311920330879e-01 +-1.257795264012394387e+00 -1.388869208939354505e-01 9.744855013641146035e-01 +-1.275794144279093656e+00 -1.863586428520041249e-01 1.066046512102955424e+00 +-1.255653371449084732e+00 -2.484248226400179727e-01 1.146022711793823978e+00 +-1.170456920844951787e+00 -3.353115042446820349e-01 1.231358753904608916e+00 +-1.100344629574701028e+00 -4.113231038476662937e-01 1.320374649523426758e+00 +-1.035227239501923080e+00 -4.161273719344224520e-01 1.447905400620237870e+00 +-9.725795472823020038e-01 -3.905890046996236542e-01 1.542238990974212243e+00 +-9.051157588753880878e-01 -3.620791655211879068e-01 1.618896770691267584e+00 +-7.841352641061271056e-01 -3.076331859168713323e-01 1.704607691540111825e+00 +-7.141062228660751687e-01 -2.750430862226990181e-01 1.721615745540707065e+00 +-5.605503603264966328e-01 -2.386359934440556163e-01 1.694559162757460324e+00 +-4.591794777935921390e-01 -2.212573319119988668e-01 1.625289688047673931e+00 +-3.946074262942785849e-01 -2.208041154336995993e-01 1.522175739999784838e+00 +-3.362680583463216188e-01 -2.043300676561103091e-01 1.414958749707809771e+00 +-2.840507880088175008e-01 -1.660120439642475132e-01 1.348204827085633273e+00 +nan nan nan +-1.820559386160588433e-01 2.557535164923129684e-02 1.224493311737196777e+00 +-1.693432663316036257e-01 1.329087855793731066e-01 1.275898749866720028e+00 +-1.967604798558711121e-01 2.381602078279632384e-01 1.340416362470682188e+00 +-2.635529716672719847e-01 3.244346740914133553e-01 1.395839306118078715e+00 +-3.434007520729758789e-01 3.825874159286440923e-01 1.415311282825748140e+00 +-5.392004562496001130e-01 4.168104841748574430e-01 1.397785134837636445e+00 +-6.487435297487238461e-01 4.391144096497509586e-01 1.336280282938171915e+00 +-7.076145049922912822e-01 4.407927069437431178e-01 1.268442806807055234e+00 +-7.486387162530048212e-01 4.196615627360294476e-01 1.168240738676996404e+00 +nan nan nan +-5.565600684354348182e-01 3.399382132295651338e-01 8.937426327471937881e-01 +-4.945224601232546258e-01 4.478668618441516980e-01 8.339331721656254581e-01 +-6.769915897222259504e-01 5.876428070173610463e-01 7.464478210198822739e-01 +-6.184513338055132037e-01 6.580122318753035549e-01 7.243525496917412321e-01 +-4.829224884206926860e-01 7.188787177781033044e-01 7.032906740380986399e-01 +nan nan nan +-3.276607447604715784e-01 8.176903589701292052e-01 9.139242203972167689e-01 +-4.300236034887224834e-01 9.598794665051855191e-01 9.445517987033332785e-01 +nan nan nan +nan nan nan +-6.549052169133299239e-01 1.115269795392394014e+00 1.004769634509658394e+00 +-6.802541684331478988e-01 1.227529332380433047e+00 1.028311688563169568e+00 +-7.683698514526025036e-01 1.538759546843198489e+00 1.142104206076133721e+00 +-7.574417687319890957e-01 1.649279203824494777e+00 1.162197012782468786e+00 +-8.274933265194523990e-01 1.666863507355452079e+00 1.198138323247831316e+00 +-8.309060596393551545e-01 1.725114580673961839e+00 1.236179176616031938e+00 +-7.860918606283348042e-01 1.727093067492771805e+00 1.271830185982667949e+00 +-7.739194101872917120e-01 1.689345636514176796e+00 1.330236549263194235e+00 +-6.931824800875079351e-01 1.595703467871798287e+00 1.473389668866560420e+00 +-7.445174649147378032e-01 1.610993700846856669e+00 1.597027361047959060e+00 +-7.080927915681529683e-01 1.637774491089880824e+00 1.649808447975280368e+00 +-5.934141091257509881e-01 1.662573867404902428e+00 1.668712188214199088e+00 +-5.179384590934673627e-01 1.633686234894226263e+00 1.704091157044160587e+00 +-4.506223991961787467e-01 1.597322067068161155e+00 1.729018470877495828e+00 +nan nan nan +-4.978554304882620851e-01 1.384606290053916888e+00 1.696642548629283764e+00 +-3.765955369355242222e-01 1.448556248602340002e+00 1.834502207868194512e+00 +-4.764410488758912821e-01 1.395941786621555991e+00 1.857918658920131083e+00 +-4.571610571567704118e-01 1.355459546647339142e+00 1.923884736210265567e+00 +-5.168333481010866093e-01 1.301482395638003720e+00 1.966957839226942006e+00 +nan nan nan +-6.407462925482083627e-01 1.361670816339637158e+00 2.053133241616538207e+00 +-6.583143559707950176e-01 1.404336593255051335e+00 2.115450294770073736e+00 +-6.609912354008691260e-01 1.442265677318589567e+00 2.147837032915854927e+00 diff --git a/examples/filtering_example/plot_structures_different_filtering.py b/examples/filtering_example/plot_structures_different_filtering.py new file mode 100644 index 00000000..bf0e5bb9 --- /dev/null +++ b/examples/filtering_example/plot_structures_different_filtering.py @@ -0,0 +1,229 @@ +""" +Plot 3-d structures inferred with different levels of filtering with matplotlib +=============================================================================== + +This example plots two 3-d structures (with matplotlib) inferred with different +levels of filtering to showcase how increasing filtering when running PASTIS +can result in a better-looking inferred structure. +""" + +import numpy as np +from mpl_toolkits.mplot3d import axes3d # noqa: F401 unused import +import matplotlib +import matplotlib.pyplot as plt +from scipy import interpolate + + +############################################################################## +# Define the interpolation function. +# ---------------------------------- +def interpolate_chromosomes(X, lengths, eps=1e-1, smooth=0): + + """ Returns a smoothed interpolation of the chromosomes. + + Parameters + ---------- + X : ndarray (n, 3) + The 3D structure + + lengths : ndarray (L, ) + The lengths of the chromosomes. Note that the sum of the lengths + should correspond to the length of the ndarray of the 3D structure. + + Returns + ------- + smoothed_X : the smoothed 3D structure, with a set of coordinates for + each chromosome (ie, the first chromosome's points will be + smoothed_X[0]). smoothed_X[0][i] will be a list with an x, y, and + z coordinate. + """ + + smoothed_X = [[], []] + + mask = np.invert(np.isnan(X[:, 0])) + + begin, end = 0, 0 + + # Loops over each chromosome + enumerated_lengths = enumerate(lengths) + for i, length in enumerated_lengths: + end += length + + # Get the current chromosome's coordinates + x = X[begin:end, 0] + y = X[begin:end, 1] + z = X[begin:end, 2] + indx = mask[begin:end] + + if not len(x): + break + + # Encode missing values with nan + if not indx[0]: + x[0] = x[indx][0] + x[indx][0] = np.nan + y[0] = y[indx][0] + y[indx][0] = np.nan + + z[0] = z[indx][0] + z[indx][0] = np.nan + + # Encode missing values with nan + if not indx[-1]: + x[-1] = x[indx][-1] + x[indx][-1] = np.nan + y[-1] = y[indx][-1] + z[indx][-1] = np.nan + z[-1] = z[indx][-1] + z[indx][-1] = np.nan + + indx = np.invert(np.isnan(x)) + + m = np.arange(len(x))[indx] + + # Get interpolation functions for the x, y, and z coordinates + f_x = interpolate.Rbf(m, x[indx], smooth=smooth) + f_y = interpolate.Rbf(m, y[indx], smooth=smooth) + f_z = interpolate.Rbf(m, z[indx], smooth=smooth) + + # Use interpolation functions to create curve segments between + # adjacent (adjacent in the parameter X, for the current chromosome) + # coordinate beads + for j in range(length - 1): + if (j < length - 2): + m = np.arange(j, j + 1 + 0.1, 0.1) + else: + m = np.arange(j, j + 1, 0.1) + smoothed_X[i].append([f_x(np.arange(m.min(), m.max(), 0.1)), + f_y(np.arange(m.min(), m.max(), 0.1)), + f_z(np.arange(m.min(), m.max(), 0.1))]) + + begin = end + + return smoothed_X + + +############################################################################## +# Define the function to scatter the beads. +# ----------------------------------------- +def scatter_beads(x, y, z, bead_size, curr_cmap, indices, ax): + last_idx = len(x) - 1 + ax.scatter(x[0], y[0], z[0], s=bead_size, color=curr_cmap(indices[0]), + label='start') + ax.scatter(x[1:last_idx], y[1:last_idx], z[1:last_idx], s=bead_size, + cmap=curr_cmap, c=indices[1:last_idx]) + ax.scatter(x[last_idx], y[last_idx], z[last_idx], s=bead_size, + color=curr_cmap(indices[last_idx]), label='end') + + +############################################################################## +# Define the function to lighten or darken our color map. +# ------------------------------------------------------- +def cmap_map(function, cmap): + # Function taken from: + # https://scipy-cookbook.readthedocs.io/items/Matplotlib_ColormapTransformations.html + + """ Applies function (which should operate on vectors of shape 3: + [r, g, b]), on colormap cmap. This routine will break any discontinuous + points in a colormap. + """ + cdict = cmap._segmentdata + step_dict = {} + # First get the list of points where the segments start or end + for key in ('red', 'green', 'blue'): + step_dict[key] = list(map(lambda x: x[0], cdict[key])) + step_list = sum(step_dict.values(), []) + step_list = np.array(list(set(step_list))) + + # Then compute the LUT, and apply the function to the LUT + def reduced_cmap(step): + return np.array(cmap(step)[0:3]) + cmap_stepped = [] + for curr_step in step_list: + cmap_stepped.append(reduced_cmap(curr_step)) + old_LUT = np.array(cmap_stepped) + new_LUT = np.array(list(map(function, old_LUT))) + # Now try to make a minimal segment definition of the new LUT + cdict = {} + for i, key in enumerate(['red', 'green', 'blue']): + this_cdict = {} + for j, step in enumerate(step_list): + if step in step_dict[key]: + this_cdict[step] = new_LUT[j, i] + elif new_LUT[j, i] != old_LUT[j, i]: + this_cdict[step] = new_LUT[j, i] + colorvector = list(map(lambda x: x + (x[1], ), this_cdict.items())) + colorvector.sort() + cdict[key] = colorvector + + return matplotlib.colors.LinearSegmentedColormap('colormap', cdict, 1024) + + +############################################################################## +# Define the function to plot the coordinates +# ------------------------------------------- +def plot_structure(struct_file_name, contact_counts, title=None): + # Load in the structure from its file + coord_arr = np.loadtxt(struct_file_name, delimiter=" ") + + # Get the length of the structure + struct_length = np.array([len(coord_arr)]) + + # Get the structures coordinates + start, end = 0, struct_length[0] + x = coord_arr[:, 0][start:end] + y = coord_arr[:, 1][start:end] + z = coord_arr[:, 2][start:end] + + # Interpolate the coordinates of the structure + chrom = np.array(interpolate_chromosomes(coord_arr, struct_length)[0]) + + # Get the plot ready + fig = plt.figure(figsize=(15, 15)) + ax = fig.add_subplot(111, projection='3d') + + # Get our colors set up. color_beads determines which color in our color + # map each bead will have. + color_indices = np.linspace(0, 1, len(x)) + + # We will use a spectral color cmap. + the_cmap = cmap_map(lambda x: x*0.85, matplotlib.cm.get_cmap('Spectral')) + + # Scatter the beads for the chromosome. + scatter_beads(x, y, z, 50, the_cmap, color_indices, ax) + + # Plot the points we interpolated that go in between the beads of the + # chromosome. + for i in range(struct_length[0] - 1): + ax.plot(chrom[i][0], chrom[i][1], chrom[i][2], + color=the_cmap(color_indices[i])) + + # Set the labels, title, legend, and view angle and position. Show the + # plot. + ax.set_xlabel('x', fontsize=20) + ax.set_ylabel('y', fontsize=20) + ax.set_zlabel('z', fontsize=20) + plt.legend(loc='best') + plt.title(title, fontsize=25) + ax.view_init(15, 300) + + +############################################################################## +# Load the contact counts +contact_counts = np.load('data/contact_counts.npy') + + +############################################################################## +# Plot the structure with less filtering. As we can see, this structure looks +# quite odd, with spikes shooting out to single beads that are far away from +# the rest of the structure. +plot_structure('data/struct_inferred_less.000.coords', contact_counts, + 'Inferred 3-d structure (Less Filtering)') + + +############################################################################## +# Plot the structure with more filtering. As we can see, this structure looks +# significantly better, as bins with low coverage in the contact counts matrix +# were filtered more heavily before PASTIS inferred the structure. +plot_structure('data/struct_inferred_more.000.coords', contact_counts, + 'Inferred 3-d structure (More Filtering)')