Mercurial > repos > jeremyjliu > region_motif_enrichment
comparison region_motif_intersect.r @ 35:4ce22698acb0 draft
Uploaded
author | jeremyjliu |
---|---|
date | Thu, 26 Feb 2015 22:54:09 -0500 |
parents | 0e031bf8c5b1 |
children | b868314320e2 |
comparison
equal
deleted
inserted
replaced
34:fe8a884363df | 35:4ce22698acb0 |
---|---|
1 # Name: region_motif_intersect.r | 1 # Name: region_motif_intersect.r |
2 # Description: Takes a bed file of target regions and counts intersections | 2 # Description: Takes a bed file of target regions and counts intersections |
3 # of each motif (in separately installed tabix database) and target regions. | 3 # of each motif (in separately installed tabix database) and target regions. |
4 # Author: Jeremy liu | 4 # Author: Jeremy Liu |
5 # Email: jeremy.liu@yale.edu | 5 # Email: jeremy.liu@yale.edu |
6 # Date: 15/02/04 | 6 # Date: 15/02/11 |
7 # Note: This script is meant to be invoked with the following command | 7 # Note: This script is meant to be invoked with the following command |
8 # R --slave --vanilla -f ./region_motif_intersect.r --args <db_bgz> <db_tbi> <inbed> <outtab> | 8 # R --slave --vanilla -f ./region_motif_intersect.r --args <db_bgz> <db_tbi> <inbed> <outtab> |
9 # Dependencies: region_motif_data_manager | 9 # Dependencies: region_motif_data_manager |
10 | 10 |
11 # Auxiliary function to concatenate multiple strings | 11 # Auxiliary function to concatenate multiple strings |
14 return(paste(input_list, sep="", collapse="")) | 14 return(paste(input_list, sep="", collapse="")) |
15 } | 15 } |
16 | 16 |
17 # Retrive motif database path | 17 # Retrive motif database path |
18 args <- commandArgs() | 18 args <- commandArgs() |
19 motifDB_bgz = args[7] | 19 motifDB_bgz = args[7].split(',')[0] # Handles duplicate entries in data table |
20 motifDB_tbi = args[8] | 20 motifDB_tbi = args[8].split(',')[0] # Just takes the first one |
21 | 21 |
22 # Set input and reference files, comment to toggle commmand line arguments | 22 # Set input and reference files, comment to toggle commmand line arguments |
23 inBed = args[9] | 23 inBed = args[9] |
24 outTab = args[10] | 24 outTab = args[10] |
25 | 25 |