Farre-lab / syntenyPlotteR

R package to draw syntenic plots in 3 different styles
https://farre-lab.github.io/syntenyPlotteR/
Other
37 stars 10 forks source link

'names' attribute [2] must be the same length as the vector [1] #1

Closed Silverfoxcome closed 1 year ago

Silverfoxcome commented 3 years ago

Good day :)

Thank you for this useful tool!

I have been trying to do a simple Pairwise Synteny Plot between 2 short genomes (chloroplast genomes, the reference and my assembly) but I should be doing something wrong, because I get this error message:

Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]

I'd be very grateful if you could help me, please :)

To draw my plot with this function

draw.pairwise("syntenicBlocks.txt", "outputFileName", "reference_chr_size", "target_chr_size", "refName", "tarName")

I started to create the necessary files. In this plot, I just want to select 2 blocks of synteny between my genomes, so I followed the guide to make the file pt_syntenicBlocks.txt

chr - chromosome of reference species -- it ONLY accepts numbers
start - start of block in reference species
end - end of block in reference species
tarChr - chromosome of target species
tarSt - start of block in target species
tarEnd - end of block in target species
orient - orientation of the block (1 or -1)
tarSpecies - name of the target species

The first field (chr - chromosome of reference species) ONLY accepts numbers so I just put 1 as the reference genome. This is the tab separed field I created:

1   0   82352   2   58057   140451  1   pt_assembly
1   82356   140384  2   0   58056   1   pt_assembly

I attach it here just in case :) : pt_syntenicBlocks.txt

For reference_chr_size I created a file refSizes_pt_ref.txt that only has this information (separated but 1 blank space):

B73_PT_REF 140384

I attach it here just in case :) : refSizes_pt_ref.txt

For target_chr_size I created a file tarSizes_pt_assembly.txt that only has this information (separated but 1 blank space)

pt_assembly 140451

I attach it here just in case :) : tarSizes_pt_assembly.txt

I called the library, function and files in the following way:

library(syntenyPlotteR)

draw.pairwise(infile = "../data/pt_syntenicBlocks.txt", output = "plotsynteny", refSizes = "../data/refSizes_pt_ref.txt", tarSizes = "../data/tarSizes_pt_assembly.txt", refName = "B73_PT_Ref", tarName = "pt_assembly")

And I get this error message: Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]

I would be very grateful if you could help. Thanks a lot in advance :)

marta-fb commented 3 years ago

Hi,

Thanks for using our tool and I apologise for my late response. To run it you don't need to call the variable, instead just type:

draw.pairwise("../data/pt_syntenicBlocks.txt", "plotsynteny", "../data/refSizes_pt_ref.txt", "../data/tarSizes_pt_assembly.txt", "B73_PT_Ref", "pt_assembly")

Marta

luisafmc commented 1 year ago

Hi! @Silverfoxcome Thank you for posting for process. I having the same struggle. I just would like to know, Was It possible to solved it with the advise of @marta-fb? I did the same with the following as output

draw.pairwise("../Desktop/Chromosome_severalSps.txt", "../Desktop/plotsynteny", "../Desktop/refSizes_pt_ref.txt", "../Desktop/tarSizes_pt_assembly.txt", "B73_PT_Ref", "pt_assembly") Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]