Unverified Commit 1c933ec1 authored by Maximilian von der Linde's avatar Maximilian von der Linde Committed by GitHub
Browse files

Add files via upload

parent 74fda16d
......@@ -17,8 +17,8 @@ grouped.data <- list()
############# read file list and plot graphs for each file #############################
xml_list <- choose.files()
if(MultiFlyDataVerification(xml_list)==TRUE) # make sure all flies in a group have the identical experimental design
{
if(MultiFlyDataVerification(xml_list)==TRUE) { # make sure all flies in a group have the identical experimental design
print("identical")
for (l in 1:length(xml_list))
{
xml_name=xml_list[l]
......@@ -51,8 +51,15 @@ if(MultiFlyDataVerification(xml_list)==TRUE) # make sure all flies in a group ha
#only look at period data
temp <- rawdata[rawdata$period == i, ]
if (sequence$type[i] == "OptomotoL") or (sequence$type[i] == "OptomotoR") {
keeps = c("a_pos","fly")
period.data[[i]] <- temp[keeps] #list only position and torque data by period
}
else{
keeps = c("a_pos","torque")
period.data[[i]] <- temp[keeps] #list only position and torque data by period
}
if(sequence$type[i]!="optomotor")
{
......
......@@ -13,6 +13,7 @@ flyDataImport <- function(xml_name) {
#parse the metadata
URIs <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/URIs"))
experimenter <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))
fly <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/fly"))
experiment <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experiment"))
......@@ -40,8 +41,7 @@ MultiFlyDataVerification <- function(xml_list)
for (l in 1:length(xml_list))
{
xml_name=xml_list[l]
##### read the data with the corresponding function #######
##### read the data with the corresponding function (readXMLdatafile.R) #######
singleflydata <- flyDataImport(xml_name)
##extract meta-data
......@@ -56,7 +56,9 @@ for (l in 1:length(xml_list))
as.vector(sequence$outcome),
as.vector(sequence$pattern),
as.vector(sequence$coup_coeff))
if(l==1){metadata<-data.frame(flymetadata)}else{metadata[,l]<-data.frame(flymetadata)}
if(l==1){
metadata<-data.frame(flymetadata)}else{
metadata[,l]<-data.frame(flymetadata)}
}
return(length(unique(as.list(metadata))) == 1)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment