Issues with using biom-format module - biom

I am trying to convert a biom file from Qiime output to an OTU table for using with other pipelines (SparCC). I have installed the module using conda but I don't seem to be able to get it to work, when I try the convert it I keep getting the same syntax error.

Related

Module not installed

I am writing a Dataframe to a Parquet file with Dask using the following code:
df.to_parquet('Filepath', engine='pyarrow')
Pyarrow module is required to run this code and it runs fine on my editor.
But when I package the code using Pyinstaller and try to run the .exe file I get the error
'pyarrow' not installed
How to fix this?
Note - I'm using the same python environment for Pyinstaller as well as my editor.

Command fails to run in RMarkdown despite working in regular R Script

I have this command and it works fine when I run it from an R script
df <- data.table::rbindlist(lapply(Sys.glob("myfolder/part-*.parquet"), arrow::read_parquet)) %>%
as_tibble() %>%
mutate(mycol = as.character(mycol))
But, when I run the same command from an RMarkdown paragraph, I get this error
Error: Problem with `mutate()` input `mycol`.
x object 'mycol' not found
ℹ Input `mycol` is `as.character(mycol)`.
And then when I run the command without the last line, then I get an empty data frame.
I'm on the most up to date r studio with the most up to date R on a Mac.
The default search path for a Markdown document is the folder where the document is located.
This might be different from the working directory used by the RStudio session.
Verify that the .Rmd file is located in the getwd() folder.
To avoid path problems, a very effective solution under RStudio is :
to work with Projects instead of standalone files
to use the here package which allows you to reference files according to the project root, see also Ode to the here package

how to fix errors in multiple .json files in one step?

I am trying to load a local json file in R. I am using a package called Sofia that includes the json library. I also tried other packages like rjson and the RJSONIO packages but I get the same error
error in ProcessFiles(File=File), unexpected character E.
This is example code when I use the a local package Sofia:
data<-ProcessFiles(file="data1.json",method="Sofia.method")
When I apply the same package to some old .json files it works normally without error. I tried to change the encoding of the file to UTF-8 but the error persists. The file encoding is ANSI Can anybody help with this?
I ran the online linter and I seemed to discover the error however I want to fix these syntax errors in multple json files in one step, does anybody know how?

R extension breaks connection to extensions directory in NetLogo

I am trying to get R and NetLogo to talk to each other using the r extension. I am passing graph objects rather than simply variables. This means I need to export a file from NetLogo and import a file in R, which means they need to point to the same directory. The code runs perfectly. However, once it is run, NetLogo loses the connection to the extensions folder.
It appears to be related to setting the working directory in R because the following MWE also creates the problem.
extensions [r]
to testSETWD
r:eval "setwd(\"C:\")"
end
After running this successfully, then trying to do any edits to the NetLogo, I get the error Can't find extension ....
As long as I don't try to edit after running the R code, NetLogo continues to work and I can use the extensions without problems. The problem only arises when I edit the code and run the syntax parser (green tick).
I have done a bug report, but it is apparently not reproducible. I am running Windows 8.1 64bit. Is this a problem for anyone else?
I found something similar when using the r extension in NetLogo.
I simply reset to the original working directory.
For example:
;retain old working directory
r:eval "oldWD <- getwd()"
;The code you are running. ie.
r:eval "setwd(\"C:\")"
r:put "something" NetLogoSomething
r:eval "ReturnedThing <- SomethingElse(something)"
;And then reset the working directory:
r:eval "setwd(oldWD)"

Importing CSV to postgres

i was trying to import csv file to postres using this command.
copy zip_codes from '/path/to/csv/ZIP_CODES.csv' DELIMITERS ',' CSV;
but i m getting an error "/path/to/csv/ZIP_CODES.csv:Permission Denied".
i came across with a solution of using \copy instead of copy but its not working probably because it dosent work in windows
How to change the permission of the file.
I m working on windows7.
The \COPY command should work in Windows. Try adding the drive letter (like "C:") to the front of the path. Also remove "DELIMITERS ','" as that's redundant since you're using CSV format.
It would also help if you added the error message from the \COPY command.

Resources