Commit d35faa8b authored by aknecht2's avatar aknecht2
Browse files

Added overlapping region selection script. Modified experiment_select.

parent 25962ac7
......@@ -3,9 +3,9 @@ import argparse
from pprint import pprint
parser = argparse.ArgumentParser(description="Perform a join between the experiment and sample collections.")
parser.add_argument("--password", dest="password", default="nerpAusIrd)griUrlobIbfaifovript4", help="Database user password.")
parser.add_argument("--username", dest="username", default="aknecht", help="Database user.")
parser.add_argument("--host", dest="host", default="hcc-anvil-175-9.unl.edu", help="Database host.")
parser.add_argument("--password", dest="password", help="Database user password.")
parser.add_argument("--username", dest="username", help="Database user.")
parser.add_argument("--host", dest="host", help="Database host.")
args = parser.parse_args()
# Everything in a db named chipseq
......
from pymongo import MongoClient
import argparse
from pprint import pprint
parser = argparse.ArgumentParser(description="Perform a join between the experiment and sample collections.")
parser.add_argument("--password", dest="password", default="nerpAusIrd)griUrlobIbfaifovript4", help="Database user password.")
parser.add_argument("--username", dest="username", default="aknecht", help="Database user.")
parser.add_argument("--host", dest="host", default="hcc-anvil-175-9.unl.edu", help="Database host.")
args = parser.parse_args()
# Everything in a db named chipseq
# Set up connection and authenticate
client = MongoClient(args.host)
db = client.chipseq
db.authenticate(args.username, args.password, mechanism="SCRAM-SHA-1")
cursor = db.gene_test.aggregate([
{
"$lookup": {
"from": "tfbs_test",
"localField": "chr",
"foreignField": "chr",
"as": "tfbs"
}
},
{
"$unwind": "$tfbs"
},
{
"$project": {
"chr": True,
"end": True,
"start": True,
"gene": True,
"tfbs": True,
"low_comp": {
"$subtract": ["$tfbs.start", "$start"]
},
"high_comp": {
"$subtract": ["$end", "$tfbs.end"]
}
}
},
{
"$match": {
"low_comp": {"$gte": 0},
"high_comp": {"$gte": 0}
}
}
])
for document in cursor:
pprint(document)
break
Supports Markdown
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