Skip to content

Commit

Permalink
Add more interaction fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aeg committed Sep 27, 2018
1 parent 5256e4b commit e041897
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions source/pipeline/main_pipeline_abstractprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ def get_localpath(path):
return tempath



def run(input_dir, out_file):
logger = logging.getLogger(__name__)
logger.info("Starting run with arguments...\n{}".format(args.__dict__))
input_dir = path_rationalise(input_dir)
local_out = get_localpath(out_file)

pipeline = SimplePipeline()
pipeline.pipeline_steps = [("Populate_Abstract", ImexDataTransformerAugmentAbstract())]

data_extractor = BulkImexProteinInteractionsExtractor(["phosphorylation"])
interaction_types = ['phosphorylation', 'dephosphorylation', 'ubiquitination',
'methylation', 'acetylation', 'deubiquitination', 'demethylation']

logger.info("Extracting interaction types {}".format( ",".join(interaction_types)))
data_extractor = BulkImexProteinInteractionsExtractor(interaction_types)
data_iter = data_extractor.get_protein_interactions(pathlib.Path(input_dir).glob('**/*.xml'))

result = pipeline.run(data_iter)
Expand All @@ -85,8 +90,6 @@ def run(input_dir, out_file):
upload_to_dest(local_out, out_file)




if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("input_dir",
Expand All @@ -96,7 +99,7 @@ def run(input_dir, out_file):

args = parser.parse_args()

#Set up logging
# Set up logging
logging.basicConfig(level=logging.getLevelName(args.log_level), handlers=[logging.StreamHandler(sys.stdout)],
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')

Expand All @@ -105,4 +108,3 @@ def run(input_dir, out_file):
run(args.input_dir,
args.out_file)
logger.info("Completed run...")

0 comments on commit e041897

Please sign in to comment.