Merging inputs of hicpro2fithic.py

46 views
Skip to first unread message

Mzwanele Ngubo

unread,
Aug 4, 2021, 3:40:49 PM8/4/21
to Fit-Hi-C
Hi.

Is it possible to merge separately the inputs of hicpro2fithic.py : raw matrix files, abs bed files and iced matrix files? Can I do this with cat and sort?

Thanks,
Mzwanele

Ferhat Ay

unread,
Aug 9, 2021, 8:45:17 AM8/9/21
to Fit-Hi-C
Not sure what you mean by "merge" as files like abs.bed will likely be identical anyway and there is no clear way to combine two different matrix files. Do you want to just sum them up which would make sense for raw but not for iced matrix files?

Mzwanele Ngubo

unread,
Aug 9, 2021, 10:36:36 PM8/9/21
to fit...@googlegroups.com
Yes. I want to sum up the raw files. I'm struggling with a proper R or python syntax to use. Any rough example of a syntax would be helpful. Thanks.

--
You received this message because you are subscribed to the Google Groups "Fit-Hi-C" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fithic+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fithic/b76394ee-9732-4a76-bd23-954571dc8795n%40googlegroups.com.

Ferhat Ay

unread,
Aug 10, 2021, 3:36:34 PM8/10/21
to Fit-Hi-C
You can create a "key" from the i j pair in the matrix file and then read the first file then the second into the same dictionary in python while summing counts if they come from both files. In awk it is also easy. you can create a key with $1"-"$2 then sort and join the two files using -a option of join. Then depending on the number of resulting columns you can either sum the counts if they come from both files or just use the count from the single file it comes from.  
Reply all
Reply to author
Forward
0 new messages