So I hadn't realized my data was actually unstructured due to some weird outputs from the 1000G data. I tried streamlining it so that your script could work but that wouldn't be ideal.
Can I edit the question so that maybe your script could be tweaked a little? I will ask it here if that's okay?
So file1 is okay, and is as follows:
1 15776220 15776240 GTGACCAGCAGGTGTCTCTG 16855676 16855696 CTGTCCAGCAGAGGGCGGTG
The columns of this file ($2, $3 and $5, $6) would be the references for intersection
@MaharshiChakravortee No, don't edit the question. What you originally asked for is completely different. Ask a new question instead. You now seem to want to check intersections across various different files. So it won't just be a minor tweak to my script. Just ask a new question but make sure to show accurate and representative examples of your data this time ;)
Hey @terdon, this is the link: https://bioinformatics.stackexchange.com/questions/3192/intersecting-two-different-files-with-one-master-file-based-on-different-colum