Hi,
so I've tried to write a small script that would extract the distance
distribution, but I can't compile it directly (it's something like my
first c program) - comments welcome.
#include <stdio.h>
#define CLUSTER_MODULE
#include <ptraj.h>
int main ( int argc, char *argv[] )
{
if (argc != 4)
{
printf("usage: %s nstructures nbins outfile\n", argv[0]);
return 1;
}
SymmetricMatrix* PairwiseDistance;
int SymMatrixReady = 0;
int FrameCount = *argv[1];
int nbins = *argv[2];
char* dest = argv[3];
char* dfile = "PairwiseDistances";
FILE* fp;
printf("assuming distance matrix is %dx%d\n",FrameCount,FrameCount);
printf("binning PairwiseDistances into %d bins\n",nbins);
printf("outputting distribution to %s\n",dest);
PairwiseDistance = AllocateSymmetricMatrix(FrameCount);
SymMatrixReady = ReadSymMatrix(dfile, PairwiseDistance);
if (!SymMatrixReady)
{
printf("Unable to read the PairwiseDistances file\n");
return 1;
}
fp = fopen(dest, "w");
SymmetricMatrixDistribution(PairwiseDistance, nbins, fp);
fclose(fp);
printf("Done.\n");
}
Jianyin Shao wrote:
> The PairwiseDistances is a binary file of n*n floating numbers. If you read
> them out sequentially, you will get (1,1), (1,2), ..., (1,n), (2,1), ...,
> (n,n).
>
> Best,
>
> Jianyin
>
> On Fri, Oct 29, 2010 at 11:03 AM, Yannick Spill <yannick.spill.pasteur.fr>wrote:
>
>
>> Thanks Jianyin!
>>
>> Is the format of PairwiseDistances something standard that I could
>> read/convert with another tool, or is there a description of it somewhere?
>>
>> Yannick
>>
>>
>>> Hi Yannick,
>>>
>>> It is hard coded. So if you want smaller bins, you need to modify the
>>> source
>>> code and recompile the ptraj.
>>> In cluster.c, search
>>> "SymmetricMatrixDistribution(This->PairwiseDistances,20,File)", then
>>> replace
>>> 20 with a larger number you want, say 100. Recompile, and you will get
>>>
>> 100
>>
>>> bins.
>>>
>>> Best,
>>>
>>> Jianyin Shao
>>>
>>> On Fri, Oct 29, 2010 at 8:57 AM, Yannick SPILL
>>> <Yannick.Spill.pasteur.fr>wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> is there a way to extract the distribution of distances from the
>>>> PairwiseDistances file after performing a (average linkage) clustering
>>>> using ptraj from amber 11 ? I'm not satisfied with the distribution it
>>>> outputs during the process, as I'd like a smaller binning.
>>>>
>>>> thanks!
>>>>
>>>> Yannick
>>>>
>>>>
>>>> _______________________________________________
>>>> AMBER mailing list
>>>> AMBER.ambermd.org
>>>> http://lists.ambermd.org/mailman/listinfo/amber
>>>>
>>>>
>>> _______________________________________________
>>> AMBER mailing list
>>> AMBER.ambermd.org
>>> http://lists.ambermd.org/mailman/listinfo/amber
>>>
>>>
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
>>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue Nov 02 2010 - 06:30:02 PDT