rcristofari / RAD-Scripts

4 stars 2 forks source link

doesn't work with output from stacks v2 #2

Open smallfishcui opened 5 years ago

smallfishcui commented 5 years ago

Hi,

I am using this script to deal with a fasta file produced from stacks v2, I followed the instruction with the command: Rscript ./RAD_Haplotypes.R --fasta=populations.loci.fa --map=/popmap_haploR_denovo20190831.txt --out=./ --type='fasta' --nind=17,15,37,6,4,9,1 --ploidy=2 --stats --save populations.loci_diploid

and I get error message like this:

Input fasta: populations.loci.fa Input populations: popmap_haploR_denovo20190831.txt Computing per-locus summary statistics Writing to fasta format Writing out files to ./ Saving to Rdata file


Loading fasta file...done. Formatting fasta file...Error in matrix(unlist(strsplit(gsub("\[|\,|\]", "", as.character(metadata$X8)), : 'data' must be of a vector type, was 'NULL' Calls: data.frame -> matrix Execution halted

I noticed this script is modified to fit the output from stacks v1.45, but I have been using the stacks V2, is the version difference the cause of this failure?

Thank you very much for your time, Cui

smallfishcui commented 5 years ago

Hi,

I made the modifications according to the pulled request, it could read the fast file but I still get the error message like this:

Input fasta: populations.loci.fa Input populations: popmap_haploR_denovo20190831.txt Computing per-locus summary statistics Writing to fasta format Writing out files to ./ Saving to Rdata file


Loading fasta file...done. Formatting fasta file...Error in data.frame(metadata$X1, metadata$X3, metadata$X7, metadata2$X3, : arguments imply differing number of rows: 4565537, 0, 4565536 Execution halted

Do you have any more updates with the script?

best, Cui

clorenzo1 commented 8 months ago

Hi,

I know this was a while ago but I am getting the same precise issues. Has/will there be any modifications to the script?

Best wishes, Coral