annotate Id_Tidy.R @ 1:f3fc8d243b1a draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
author ecology
date Fri, 26 Apr 2019 12:20:52 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
1 suppressMessages(library(data.table))
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
2
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
3 args <- commandArgs(trailingOnly = TRUE)
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
4 #print(args)
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
5 filename=args[2]
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
6
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
7 DataPar=fread(args[1]) #ids
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
8 DataPar$participation=substr(filename,nchar(filename)-40,nchar(filename)-17)
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
9 #DataPar$participation=substr(args[1],nchar(args[1])-40,nchar(args[1])-17)
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
10 test1=duplicated(cbind(DataPar$'nom du fichier',DataPar$tadarida_taxon))
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
11 test2=(DataPar$tadarida_taxon=="empty")
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
12 DataPar=subset(DataPar,(!test1)|(test2))
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
13 DataPar$tadarida_probabilite[DataPar$tadarida_probabilite==""]="0"
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
14 DataPar$tadarida_probabilite=as.numeric(DataPar$tadarida_probabilite)
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
15
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
16 #write.table(DataPar,paste0(substr(args[1],nchar(args[1])-40,nchar(args[1])-17),"-DataCorrC2.csv"),row.names=F,sep="\t")
f3fc8d243b1a planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
ecology
parents:
diff changeset
17 write.table(DataPar,"Id_tidy.tabular",row.names=F,sep="\t")