Entering edit mode
4.3 years ago
harry
▴
40
I have one output.txt file in which there are 20000 strings. see below it looks like that. It is genome coordinate file.
X:10063445|10067490
X:10063445|10079804
X:10063445|10098579
X:10063445|10110020
X:100914621|100915083
X:101018971|101019403
X:101018971|101020588
X:101020487|101021315
X:101020487|101023616
X:101035613|101038051
X:101035613|101041371
X:101035613|101042312
X:101041317|101042312
X:101101058|101109998
X:101101058|101148161
X:101120402|101120784
X:101126709|101148161
X:101895814|101898042
I want to grep these string in my result.txt file which have 10 column text file and the 1st column is look like output.txt file. I just want output of those strings are present or not in my result.txt file and save in another test file. I also want to extract total 1st 5 column which are present in result.txt file.
Thank you so much in advance.
You can work with bed files and use
bedtools intersect
. You can do somegrep
andawk
magic (how do you define intersection? Do you want exactly the same coordinates?) but it will probably be messy.i just want there is any way to include both intersect and not intersect strings in my output intersect.bed file.
Please add representative output.
and few lines from both the input files.
here is 1st input -
2nd input file-
till now i used bedtools intersect to intersect of both file but it give result only of intersect and i also want which are not intersect also in the same result file. i use command--
So is there any way to include result of both intersect and not intersect in same intersect.bed file like this i want my result -
so here i expected output result like this which include both intersect and not intersect . thanks
I lost you. If you want the intersecting and non-intersecting, isn't it all of the input file?
no it contains some data of input file. i don't upload whole input . so can you suggest me how do i get both intersect and non-intersect in same file.
Take a look at this SO post, I think it answers your question: https://stackoverflow.com/questions/2619562/joining-multiple-fields-in-text-files-on-unix
Query is confusing. Can you post a small worked out example? @ harry