Hi all, When I go to load a csv into a table, I get the error below. Synapse seems to recognize the format of how the table should be (ie the header appears properly with the data type when I begin the import, I hit continue and get the following error). What is tripping up the importing? The first line is expected to be a header but the values do not match the names of of the columns of the table (Individual_ID,BrainBank,Gender,Ethnicity,Age_of_Death,PMI_hrs,Dx,DLPFC_RNAseq,ACC_RNAseq,DNA_genotyping,DNA_WGS,DLPFC_RNA,ACC_RNA,DLPFC_RNA_array,Hippo_RNA_array,Dura_RNA_array,DLPFC_NeuN_Pos_H3K4me3_ChIP,DLPFC_NeuN_Neg_H3K4me3_ChIP,DLPFC_NeuN_Pos_H3K27ac_ChIP,DLPFC_NeuN_Neg_H3K27ac_ChIP,DLPFC_noFACS_H3K27ac_ChIP,DLPFC_NeuN_Pos_Input_ChIP,DLPFC_NeuN_Neg_Input_ChIP,ACC_NeuN_Pos_H3K4me3_ChIP,ACC_NeuN_Neg_H3K4me3_ChIP,ACC_NeuN_Pos_H3K27ac_ChIP,ACC_NeuN_Neg_H3K27ac_ChIP,ACC_NeuN_Pos_Input_ChIP,ACC_NeuN_Neg_Input_ChIP is not a vaild column name or id). Header row: Individual_ID,BrainBank,Gender,Ethnicity,Age_of_Death,PMI_hrs,Dx,DLPFC_RNAseq,ACC_RNAseq,DNA_genotyping,DNA_WGS,DLPFC_RNA,ACC_RNA,DLPFC_RNA_array,Hippo_RNA_array,Dura_RNA_array,DLPFC_NeuN_Pos_H3K4me3_ChIP,DLPFC_NeuN_Neg_H3K4me3_ChIP,DLPFC_NeuN_Pos_H3K27ac_ChIP,DLPFC_NeuN_Neg_H3K27ac_ChIP,DLPFC_noFACS_H3K27ac_ChIP,DLPFC_NeuN_Pos_Input_ChIP,DLPFC_NeuN_Neg_Input_ChIP,ACC_NeuN_Pos_H3K4me3_ChIP,ACC_NeuN_Neg_H3K4me3_ChIP,ACC_NeuN_Pos_H3K27ac_ChIP,ACC_NeuN_Neg_H3K27ac_ChIP,ACC_NeuN_Pos_Input_ChIP,ACC_NeuN_Neg_Input_ChIP

Created by Laura Sloofman lauragails
Props for your use of the strike-out. And thanks for the snippet + bug filing. I understand what you're doing with your code and if it doesn't work, I'll add my own fix.
I will file that as a critical bug in the R client - the behavior shouldn't be different. I'm sure it is because base R doesn't --like-- allow spaces and colons in the filenames. I know our developer won't like it, but we could be using a package (`tibble`, `dplyr`, or `data.table`) that does this for us. What you can do now is insert a line that renames your columns back to how they originally are in the data frame (if you load your data using `readr::read_csv` it won't touch your names at all too). I didn't test completely but I think this should work: ```r # Read data, don't let base R mangle your column names d <- readr::read_csv('~/scratch/toy-data.tsv') # Column names will now be mangled in the schema definitions tc <- as.tableColumns(d)$tableColumns # Un-mangle the column names mycols <- lapply(1:length(tc), function(x) { tmp <- tc[[x]]; tmp$name <- colnames(d[, x]); tmp}) ```
Soooo false alarm on the AOK. You will notice that all the files with a "_new" suffix in syn7077749 have no data, likely because the spaces and colons in the filenames are being removed, instead of being smartly translated to an underscore, as is what happens when you load one of these tables in manually (see syn9730556 as an example). I am loading the table with the same sample code I used in my test cases, and that I posted here. For reference, in the csv file that I'm uploading, a few columns in a sample header are: "RNA_seq_cln: Individual ID","RNA_seq_cln: Institution","RNA_seq_dissection: Brain Region" [etc] Thanks again, Kenny!
They updated the package and it works now. Thanks!
Looks like that's exactly what's happening. That leads to Version: 1.13-4. I'll write the administrator and ask if they can upgrade this. Thanks!
You are. You probably have something installed globally on your system (maybe installed as root) and something locally installed. Try:   ``` find.package('synapseClient') ```
hmmm this is weird. I'm using 1.13-4, and I'm getting a message that says: ``` Please upgrade to the latest version of the Synapse Client, 1.14-3, by running the following commands: source('http://depot.sagebase.org/CRAN.R') pkgInstall("synapseClient") ``` So I ran those two commands, and things looked like they installed. But then when I restarted R and ran a synapse command, I'm still getting that same upgrade message (and my version is still 1.13-4). Even weirder: Despite still getting that error message, this code is uploading a sample table correctly, which I just put in syn7077749. Am I using the correct commands to upgrade to 1.14?
That's your R version - I meant the version of the R Synapse client:   ``` ?synapseClient ```
I tried versions 3.0.1 and 3.1.1
What version of the R client are you using? I think this should be fixed in 1.14: https://sagebionetworks.jira.com/browse/SYNR-1066
Getting more weird errors! Running this command: Rscript upload_to_synapse_tables.R ~/scratch/testtable syn7077749 where upload_to_synapse_tables.R is: ``` require(synapseClient) synapseLogin() args = commandArgs(trailingOnly=TRUE) file=args[1] synapse_parent=args[2] df=read.csv(file,header=TRUE) df_name=basename(file) tc <- as.tableColumns(df) schema <- TableSchema(df_name,synapse_parent, tc$tableColumns) df_table=Table(schema,df) synStore(df_table) ``` successfully loads my test table in syn7077749, yet produces the following error message: ``` Welcome lauragails! % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42 0 0 100 42 0 500 --:--:-- --:--:-- --:--:-- 512 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42 0 0 100 42 0 457 --:--:-- --:--:-- --:--:-- 466 Error in getS4ClassNameFromSchemaName(concreteTypeSchemaName) : No S4 class name for org.sagebionetworks.repo.model.table.TableUpdateTransactionRequest Calls: synStore ... createS4ObjectFromList -> getS4ClassNameFromSchemaName ``` Additionally, I'm having issues uploading another table with headers that have spaces using the same upload_to_synapse_tables.R script, however when I loaded the tables manually, they were fine. These tables are the ".csv" tables in syn7077749, that I loaded today, April 19. Thanks for looking into this!
My guess is a wayward comma somewhere in a row that is 'adding' a column while trying to import. I'd have to see the data to confirm. If you can upload it somewhere in the Project it belongs to and share it with me, I'll give it a try!
Confirmed.
I tried to use your header but didn't have any data, so kept all columns blank for one row. I got it to import here: syn8457855   Can you confirm that all the columns are there?

Not Working: Manual read csv to import data to tables page is loading…