comparison intersect_and_adjacent.py @ 3:10000414e916 draft

planemo upload commit 28919dd79f328dd09dae92661dc19ffa5757a765
author cpt
date Mon, 12 Aug 2024 04:23:34 +0000
parents 923d2528480d
children 3e3b5ba626b9
comparison
equal deleted inserted replaced
2:0dbc7fbad0ab 3:10000414e916
266 type=int, 266 type=int,
267 default=50, 267 default=50,
268 help="Allows features this far away to still be considered 'adjacent'", 268 help="Allows features this far away to still be considered 'adjacent'",
269 ) 269 )
270 parser.add_argument( 270 parser.add_argument(
271 "-stranding", 271 "stranding",
272 action="store_true", 272 nargs="?",
273 help="Only allow adjacency for same-strand features", 273 default="",
274 help="Only allow adjacency for same-strand features if set to '-stranding'",
274 ) 275 )
275 parser.add_argument("--oa", type=str, default="a_hits_near_b.gff") 276 parser.add_argument("--oa", type=str, default="a_hits_near_b.gff")
276 parser.add_argument("--ob", type=str, default="b_hits_near_a.gff") 277 parser.add_argument("--ob", type=str, default="b_hits_near_a.gff")
277 args = parser.parse_args() 278 args = parser.parse_args()
278 279
280 stranding = args.stranding == "-stranding"
279 b, a = intersect(args.a, args.b, args.window, args.stranding) 281 b, a = intersect(args.a, args.b, args.window, args.stranding)
280 282
281 with open(args.oa, "w") as handle: 283 with open(args.oa, "w") as handle:
282 for rec in a: 284 for rec in a:
283 gffWrite([rec], handle) 285 gffWrite([rec], handle)