# HG changeset patch # User stevecassidy # Date 1481770437 18000 # Node ID f188eb0b526d65eef4292c2f617c679f5e91b0c2 # Parent 6f4db0e89117af7d211b025ff48a152122cfbfd9 planemo upload commit 2d22bc12c66a3d1949d4bf4c84e7ce7c4610383c-dirty diff -r 6f4db0e89117 -r f188eb0b526d cut_timeseries.py --- a/cut_timeseries.py Thu Dec 08 01:45:31 2016 -0500 +++ b/cut_timeseries.py Wed Dec 14 21:53:57 2016 -0500 @@ -68,7 +68,7 @@ with open(tsfile, 'r') as fd: reader = csv.reader(fd, dialect=csv.excel_tab) for row in reader: - if row[0] == 'sampletime': + if row[0] == 'time': tsheader = row elif float(row[0]) > start and float(row[0]) < end: collect.append(row) diff -r 6f4db0e89117 -r f188eb0b526d cut_timeseries.xml --- a/cut_timeseries.xml Thu Dec 08 01:45:31 2016 -0500 +++ b/cut_timeseries.xml Wed Dec 14 21:53:57 2016 -0500 @@ -20,7 +20,7 @@ - + diff -r 6f4db0e89117 -r f188eb0b526d g_cepstrum.xml --- a/g_cepstrum.xml Thu Dec 08 01:45:31 2016 -0500 +++ b/g_cepstrum.xml Wed Dec 14 21:53:57 2016 -0500 @@ -2,7 +2,6 @@ using wrassp - R r-wrassp @@ -12,6 +11,13 @@ ${fftLength} + + + + diff -r 6f4db0e89117 -r f188eb0b526d g_f0.xml --- a/g_f0.xml Thu Dec 08 01:45:31 2016 -0500 +++ b/g_f0.xml Wed Dec 14 21:53:57 2016 -0500 @@ -2,7 +2,6 @@ using wrassp ksvF0 pitch tracker - R r-wrassp @@ -11,6 +10,12 @@ ${beginTime} ${endTime} ${windowShift} ${gender} ${maxF} ${minF} ${minAmp} ${maxZCR} + + + diff -r 6f4db0e89117 -r f188eb0b526d g_forest.xml --- a/g_forest.xml Thu Dec 08 01:45:31 2016 -0500 +++ b/g_forest.xml Wed Dec 14 21:53:57 2016 -0500 @@ -2,7 +2,6 @@ using wrassp formant tracker - R r-wrassp @@ -13,6 +12,12 @@ ${window} ${preemphasis} + + + diff -r 6f4db0e89117 -r f188eb0b526d get_fm_at_midpoint.R --- a/get_fm_at_midpoint.R Thu Dec 08 01:45:31 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ - -library(wrassp) - -get_fm_at_midpoint <- function(segments, wavmap) { - midpoint_fm <- function(row) { - start = as.numeric(row[1]) - end = as.numeric(row[2]) - identifier = row[5] - fn = wavmap[identifier] - if (is.na(fn)) { - cat("Can't find wav file for ", identifier, "\n") - return(c(0,0,0,0)) - } else { - res = forest(fn, beginTime=start, endTime=end, toFile=FALSE) - return(res$fm[nrow(res$fm)/2,]) - } - } - - print(wavmap) - - fm = t(apply(segments, 1, midpoint_fm)) - fm = data.frame(fm=fm, labels=segments$label, identifier=segments$identifier) - - return(fm) -} - -args = commandArgs(TRUE) -# args will be like -# qresult.dat outfile.dat --wavfile a,b,c --identifier A,B,C -# need to split out wavfile and identifier args on , - -if (length(args) != 6) { - print("Wrong number of arguments!") - exit(1) -} - -segmentfile = args[1] -wavfiles = args[4] -identifiers = args[6] -outfile = args[2] - -# split on comma -wavfiles = strsplit(wavfiles, ",")[[1]] -identifiers = strsplit(identifiers, ",")[[1]] - -if( length(wavfiles) != length(identifiers)) { - print("Lengths of wavfiles and identifiers don't match.") - exit(1) -} -cat("\nWAVMAP\n") -wavmap = NULL -for(i in 1:length(wavfiles)) { - wavmap[identifiers[i]] = wavfiles[i] -} - -segments = read.table(segmentfile, header=TRUE) - -result = get_fm_at_midpoint(segments, wavmap) - -write.table(result, file=outfile, sep="\t", quote=F, row.names=F) diff -r 6f4db0e89117 -r f188eb0b526d get_fm_at_midpoint.xml --- a/get_fm_at_midpoint.xml Thu Dec 08 01:45:31 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - - using wrassp formant tracker - - - R - r-wrassp - - - - r_wrapper.sh $__tool_directory__/get_fm_at_midpoint.R --args ${segments} ${output} --wavfile "${",".join(map(str, $wavfile))}" --identifier "${",".join(map(str, [w.element_identifier for w in $wavfile]))}" - - - - - - - - - - - - - - - - - - - - - Calculate the formant tracks for segments of some audio files - and extract the value at the midpoint. Tabulate these values in the result. - - - - @Manual{, - title = {wrassp: an R wrapper to the ASSP Library}, - author = {Lasse Bombien and Raphael Winkelmann and Michel - Scheffers}, - year = {2016}, - note = {R package version 0.1.4}, - } - - -