grunwaldlab / metacoder

Parsing, Manipulation, and Visualization of Metabarcoding/Taxonomic data
http://grunwaldlab.github.io/metacoder_documentation
Other
135 stars 28 forks source link

Error in names vector length using primersearch_raw #326

Closed rogmei closed 2 years ago

rogmei commented 2 years ago

Hi, in my script I am looping through a bunch of files using primersearch_raw. Some files contain one fasta file others contain multiple fasta files. For some files primersearch_raw return 0 results without errors, for other files amplicons are returned, but for some files I get the error produced below and the script stops. My Embossversion is 6.5.0.0. Appreciate any help to resolve this issue.

fastafilepath [1] "path to file\71168_Geotria_australis.fasta" forward_primer [1] "GGATTAGATACCCYACTATGC" reverse_primer [1] "GATTGCGCTGTTATCCCTAG" mismatch_pr [1] 10 primersearch_raw(file = fastafilepath, forward = forward_primer, reverse = reverse_primer, mismatch = mismatch_pr)

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

traceback() 4: colnames<-(*tmp*, value = c("pair_name", "amplimer", "input", "name", "f_primer", "f_start", "f_mismatch", "r_primer", "r_start", "r_mismatch")) 3: parse_primersearch(output_path) 2: dplyr::as_tibble(parse_primersearch(output_path)) 1: primersearch_raw(file = fastafilepath, forward = forward_primer, reverse = reverse_primer, mismatch = mismatch_pr)

Note that the fileextension had to be changed from fasta to txt to allow upload. Fastafile downloaded from genbank using entrez_fetch from the rentrez package. 71168_Geotria_australis.txt ]

zachary-foster commented 2 years ago

Thanks for including code and data! I will try to take a look at it soon

zachary-foster commented 2 years ago

I think I fixed it. Try installing the development version and see if it works now. Thanks!

install.packages("devtools")
devtools::install_github("grunwaldlab/metacoder")
rogmei commented 2 years ago

Hi Zachary

Thanks for the quick reply. Tried the developmental metacoder version and it works now. 😊

Best Roger

Fra: Zachary Foster @.> Sendt: torsdag 4. november 2021 18:52 Til: grunwaldlab/metacoder @.> Kopi: Roger Meisal @.>; Author @.> Emne: Re: [grunwaldlab/metacoder] Error in names vector length using primersearch_raw (Issue #326)

I think I fixed it. Try installing the development version and see if it works now. Thanks!

install.packages("devtools")

devtools::install_github("grunwaldlab/metacoder")

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgrunwaldlab%2Fmetacoder%2Fissues%2F326%23issuecomment-961281779&data=04%7C01%7Croger.meisal%40moreforsking.no%7Ca944dc28200a4acf885608d99fbbda24%7C2e4369cbe2f24bb4b3b0007916c19c7b%7C0%7C0%7C637716451436447636%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6N8qYvgmmgVxfdmmdQVmj1E502tECI2vEBiwswwvknk%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAWJO4ATYOW36PUBYO67R4VLUKLI6JANCNFSM5HLJNLRQ&data=04%7C01%7Croger.meisal%40moreforsking.no%7Ca944dc28200a4acf885608d99fbbda24%7C2e4369cbe2f24bb4b3b0007916c19c7b%7C0%7C0%7C637716451436457597%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QqrQWgMM9R8DORIjk0hrwuL8PXvb9uClkgTo9PBsZz4%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Croger.meisal%40moreforsking.no%7Ca944dc28200a4acf885608d99fbbda24%7C2e4369cbe2f24bb4b3b0007916c19c7b%7C0%7C0%7C637716451436457597%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JNQemvetSE7bUc0aaIVWIfQrtz3RJqeV%2BLg2ew99Br4%3D&reserved=0 or Androidhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Croger.meisal%40moreforsking.no%7Ca944dc28200a4acf885608d99fbbda24%7C2e4369cbe2f24bb4b3b0007916c19c7b%7C0%7C0%7C637716451436457597%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=504LLt0Ess6hnojMz10J2ePAFDZYCpVoOXqGFuv8x8o%3D&reserved=0.