unused

Module: unused

Currently unused functions.

Authors:

Copyright 2015, Sage Bionetworks (http://sagebase.org), Apache v2.0 License

Functions

mhealthx.unused.concatenate_dataframes_to_synapse_table(tables, synapse_project_id, table_name, username='', password='')

Concatenate multiple pandas DataFrames with the same column names, and store as a Synapse table.

tables : list of pandas DataFrames
each dataframe has the same column names
synapse_project_id : string
Synapse ID for project to which output is to be written
table_name : string
schema name of table
username : string
Synapse username (only needed once on a given machine)
password : string
Synapse password (only needed once on a given machine)
table_data : Pandas DataFrame
output table data
table_name : string
schema name of table
synapse_table_id : string
Synapse ID for table
synapse_project_id : string
Synapse ID for project
>>> import pandas as pd
>>> from mhealthx.unused import concatenate_dataframes_to_synapse_table
>>> df1 = pd.DataFrame({'A': ['A0', 'A1', 'A2', 'A3'],
>>>                     'B': ['B0', 'B1', 'B2', 'B3'],
>>>                     'C': ['C0', 'C1', 'C2', 'C3'],
>>>                     'D': ['D0', 'D1', 'D2', 'D3']},
>>>                    index=[0, 1, 2, 3])
>>> df2 = pd.DataFrame({'A': ['A4', 'A5', 'A6', 'A7'],
>>>                     'B': ['B4', 'B5', 'B6', 'B7'],
>>>                     'C': ['C4', 'C5', 'C6', 'C7'],
>>>                     'D': ['D4', 'D5', 'D6', 'D7']},
>>>                     index=[0, 1, 2, 3])
>>> tables = [df1, df2]
>>> synapse_project_id = 'syn4899451'
>>> table_name = 'Test to join tables'
>>> username = ''
>>> password = ''
>>> table_data, table_name, synapse_table_id, synapse_project_id = concatenate_dataframes_to_synapse_table(tables, synapse_project_id, table_name, username, password)
mhealthx.unused.convert_audio_files(input_files, file_append, command='ffmpeg', input_args='-i', output_args='-ac 2')

Convert audio files to new format.

Calls python-audiotranscode (and faad2)

input_files : list of strings
full path to the input files
file_append : string
append to each file name to indicate output file format (e.g., ‘.wav’)
command : string
executable command without arguments
input_args : string
arguments preceding input file name in command
output_args : string
arguments preceding output file name in command
output_files : list of strings
each string is the full path to a renamed file
>>> from mhealthx.unused import convert_audio_files
>>> input_files = ['/Users/arno/mhealthx_working/mHealthX/phonation_files/test.m4a']
>>> file_append = '.wav'
>>> command = '/home/arno/software/audio/ffmpeg/ffmpeg'
>>> input_args = '-i'
>>> output_args = '-ac 2'
>>> output_files = convert_audio_files(input_files, file_append, command, input_args, output_args)