Re: [R-sig-phylo] ape package in R

2020-09-19 Thread Emmanuel Paradis
Hi,

Actually, Ranjita can use the number of gene copies if it is reasonable to 
assume that these numbers evolve among samples, maybe a stepwise model with 
transitions: 

n -> n + 1
n -> n - 1

In that case, a simple approach is to calculate the Euclidean distances among 
samples and do an NJ or ME tree. Another approach is to use phangorn and a 
parsimony or maximum likelihood (ML) method depending on the model you want to 
assume.

The functions needed are in different packages (as usual you are advised to 
check the help pages and the options):

utils::read.csv
stats::dist
ape::nj
ape::fastme.bal
phangorn::phyDat
phangorn::parsimony

And as suggested by Salvador, if you have the sequences of the gene copies for 
each sample (which would be a very nice study), you can get the evolutionary 
distances with:

ape::dist.dna

or fit an evolutionary model by ML with phangorn::pml.

HTH.

Best,

Emmanuel

- Le 20 Sep 20, à 3:14, Salvador Espada Hinojosa salvador.esp...@gmail.com 
a écrit :

> If you want to use ape for making a phylogenetic tree, I think you need the
> actual sequences of the genes, and not only the copy numbers
> 
> El sáb., 19 sept. 2020 a las 21:40, Ranjita Thapa ()
> escribió:
> 
>> Hi,
>>
>> I want to construct a phylogenetic tree with ape package. I have a csv
>> file with gene ids and copy number for each gene across different samples.
>> I want to construct phylogenetic tree. I am wondering how could I convert
>> the csv file to input file for ape. Could you please suggest me how can I
>> convert csv file to input file that is acceptable by ape?
>>
>> Thanks
>> Ranjita___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at
>> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>>
> 
> 
> --
> Salvador Espada Hinojosa
> Monika Bright's Lab
> Department of Functional and Evolutionary Ecology
> University of Vienna
> Althanstraße, 14
> 1090 Vienna (Austria)
> Mobile: (+43) 660 5952724
> skype: salva_e
> http://salvae.net 
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] ape package in R

2020-09-19 Thread Salvador Espada Hinojosa
If you want to use ape for making a phylogenetic tree, I think you need the
actual sequences of the genes, and not only the copy numbers

El sáb., 19 sept. 2020 a las 21:40, Ranjita Thapa ()
escribió:

> Hi,
>
> I want to construct a phylogenetic tree with ape package. I have a csv
> file with gene ids and copy number for each gene across different samples.
> I want to construct phylogenetic tree. I am wondering how could I convert
> the csv file to input file for ape. Could you please suggest me how can I
> convert csv file to input file that is acceptable by ape?
>
> Thanks
> Ranjita___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>


-- 
Salvador Espada Hinojosa
Monika Bright's Lab
Department of Functional and Evolutionary Ecology
University of Vienna
Althanstraße, 14
1090 Vienna (Austria)
Mobile: (+43) 660 5952724
skype: salva_e
http://salvae.net 

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] ape package in R

2020-09-19 Thread Ranjita Thapa
Hi,

I want to construct a phylogenetic tree with ape package. I have a csv file 
with gene ids and copy number for each gene across different samples. I want to 
construct phylogenetic tree. I am wondering how could I convert the csv file to 
input file for ape. Could you please suggest me how can I convert csv file to 
input file that is acceptable by ape? 

Thanks
RanjitaGENE,SAMN05064989,SAMN05064990,SAMN05064991,SAMN05064992,SAMN05064993,SAMN05064994,SAMN05064995,SAMN05064996,SAMN05064997,SAMN05064998,SAMN05064999,SAMN05065000,SAMN05065001
MD00G1000200,1.999678,2.644484,1.843331,1.868703,2.034242,1.752502,1.859093,2.039209,2.441564,2.711497,2.184576,1.473055,1.876445
MD00G1000300,1.415342,1.48209,1.549128,1.706571,2.046146,1.158263,1.646863,1.173129,1.59711,1.738894,1.419168,1.371778,1.568272
MD00G1000400,1.398499,1.797129,1.802143,1.166775,1.390045,1.236685,1.314259,1.58712,1.303329,1.782833,1.305629,1.461014,1.712468
MD00G1000500,2.41541,4.003027,2.883078,2.829228,2.876289,2.686079,2.253276,2.52543,2.45406,3.053208,3.668503,3.119604,2.609322
MD00G1000600,1.357889,1.514805,1.754632,1.905162,1.853981,1.248514,1.889641,1.832417,1.537696,1.39775,1.808635,1.389049,1.623491
MD00G1000700,1.629476,2.228273,2.048752,1.74234,1.974563,1.961737,2.069386,1.617159,1.82523,1.496132,2.092336,2.065827,1.946314
MD00G1000800,1.896418,2.22733,1.985247,1.983065,1.83869,1.9923,1.68222,1.750361,1.779146,2.209676,1.973086,1.981803,1.630689
MD00G1000900,3.134369,2.734057,2.550392,3.401735,3.493074,2.421759,2.86019,3.21655,2.768818,2.675039,3.344572,2.324965,2.332387
MD00G1001000,1.933826,1.876517,2.021223,1.739334,1.900607,1.864082,1.791559,1.847408,1.798716,2.155571,1.955044,2.377852,1.829788
MD00G1001100,0.945261,1.069836,1.105532,1.39809,1.147328,1.434332,1.195645,0.999553,0.836034,1.329002,1.742932,0.969243,1.431592
MD00G1001200,2.231896,2.332669,3.101326,2.176223,3.526095,2.718395,2.382203,2.327535,2.215922,1.528227,2.62628,2.409097,3.385232
MD00G1001300,4.502762,3.921681,4.116981,3.10278,3.640254,3.509639,3.559179,3.580477,3.159958,3.558723,4.421366,4.787455,4.684205
MD00G1001400,2.236153,2.537318,2.032665,2.0862,2.509157,2.348267,2.240651,2.156838,1.998623,2.466158,2.506128,2.508376,2.115701
MD00G1001500,2.238276,2.20046,2.405819,2.438955,2.578238,2.362307,2.68222,2.044836,2.145149,2.553174,2.299561,2.901258,2.219329
MD00G1001700,12.567245,11.491921,12.917022,9.731756,10.496296,10.999282,10.04299,11.116823,11.920293,10.890662,10.974454,9.573012,10.618516
MD00G1001800,2.255836,2.143793,2.275005,2.017084,2.705015,2.045186,2.490839,2.174137,2.108093,2.173543,2.182403,1.969187,2.330892
MD00G1001900,2.611557,3.243386,2.359358,2.605919,2.039701,2.751724,2.535086,2.946174,2.491261,2.874563,2.854939,2.685266,3.34816
MD00G1002000,2.41494,2.463868,2.470049,2.613261,2.576815,2.296066,2.277826,2.382715,2.329795,2.857351,2.16088,2.585115,2.3057
MD00G1002100,1.856245,1.766623,2.192718,1.9758,1.372465,1.346592,1.294279,2.434389,2.401637,1.943977,2.171607,2.156644,1.889808
MD00G1002200,2.415919,2.234855,2.118146,2.487616,1.265053,1.655353,1.578375,1.438708,1.571695,1.564428,2.190602,2.621737,2.232404
MD00G1002500,1.794938,2.574585,2.19974,2.300694,2.203994,2.157548,2.21563,2.38745,1.942388,2.597048,2.321994,2.174149,1.843977
MD00G1002600,2.511032,2.147372,2.178689,2.033836,2.076008,1.957138,3.11344,2.450917,3.184336,2.385136,3.445098,2.460429,2.427365
MD00G1002700,2.466562,2.200628,2.402447,1.768002,2.576956,2.776423,2.992975,2.044115,3.389897,2.034527,3.470035,4.297166,2.281435
MD00G1002800,3.994084,3.585871,4.357335,4.134188,3.843827,4.029738,5.410013,4.366464,5.32427,5.007784,5.071291,4.958608,4.356433
MD00G1003400,2.028538,2.072182,2.080781,2.25311,2.311936,2.206668,2.107647,1.86438,1.809568,2.150551,2.07075,2.415351,2.620719
MD00G1003500,2.226612,1.528872,1.259334,1.752868,1.8164,1.521194,1.386067,1.855044,2.288861,1.823343,1.259023,1.369945,1.69697
MD00G1003600,1.073772,1.715179,2.027966,1.970396,2.462572,1.751237,2.013319,1.483089,1.99988,1.443287,2.069001,1.939983,1.855052
MD00G1003800,2.390463,2.873044,2.403015,2.404447,2.018727,2.537998,2.189413,2.712841,2.135105,2.285238,2.239648,2.636597,2.004905
MD00G1003900,1.703446,1.970978,1.510863,1.712658,1.421343,2.311724,1.868775,2.210896,1.416742,1.720507,1.567725,1.078489,1.795938
MD00G1004000,1.703446,1.970978,1.510863,1.712658,1.421343,2.311724,1.868775,2.210896,1.416742,1.720507,1.567725,1.078489,1.795938
MD00G1004100,2.077799,1.755617,1.755502,1.791851,1.969101,2.207733,1.756074,2.178037,1.699324,1.789315,1.634722,1.565095,2.105419
MD00G1004200,2.548076,2.641978,2.604369,2.44473,1.836607,1.962447,2.378719,2.61517,2.478992,2.56008,2.582974,1.634768,1.673753
MD00G1004300,1.612036,1.967232,2.218305,1.745579,1.786646,1.702544,2.079315,1.724835,2.201695,1.814631,2.220065,2.921447,2.336502
MD00G1004400,2.164274,3.437788,2.550175,2.197593,2.42354,2.774165,2.647565,2.981612,3.011943,2.766472,2.750117,2.558302,2.101304