Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need more details about program usepopsrootanc #11

Closed
congzhouczcz opened this issue Apr 1, 2020 · 4 comments
Closed

Need more details about program usepopsrootanc #11

congzhouczcz opened this issue Apr 1, 2020 · 4 comments

Comments

@congzhouczcz
Copy link

Hi ,
The commond line of program 'usepopsrootanc'
glactools usepopsrootanc [options]
What is the format of file ? the glac file contains root and ancestral samples?
Thanks!

@congzhouczcz
Copy link
Author

What is the format of file 'pop to use as root' and 'pop to use as anc' ?
Thanks very much!

@grenaud
Copy link
Owner

grenaud commented Apr 1, 2020

Hello!
Suppose you have a file with the populations you want to use as outgroup and ancestor. In the case of hominin, it would be the chimp as outgroup and the Chimp/human ancestor as the ancestor. For example I would have the following

file1.acf.gz:

#ACF
#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz 
#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574
#DATE: 2019-12-02
#SQ	SN:1	LN:249250621
#SQ	SN:2	LN:243199373
#chr	coord	REF,ALT	root	anc	chimp	ChimpHumanAncestor
2	100022	A,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100023	G,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100024	A,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100025	C,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100026	A,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100027	G,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100028	A,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100029	A,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100030	C,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100031	T,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100032	T,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100033	C,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100034	A,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100035	T,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100036	T,N	0,0:0	0,0:0	1,0:0	1,0:0
2	100037	G,N	0,0:0	0,0:0	1,0:0	1,0:0

And I would have a second file without root and ancestral information:

file2.acf.gz:

#ACF
#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz 
#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574
#DATE: 2019-12-02
#SQ	SN:1	LN:249250621
#SQ	SN:2	LN:243199373
#chr	coord	REF,ALT	root	anc	AltaiNean	Denisova	FrenchB	YorubaB	AustralianB
2	100022	A,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100023	G,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100024	A,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100025	C,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100026	A,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100027	G,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100028	A,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100029	A,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100030	C,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100031	T,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100032	T,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100033	C,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100034	A,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100035	T,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100036	T,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100037	G,N	0,0:0	0,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0

First we will go into file1 and it take our two populations as our root and ancestor and put it into file3.acf.gz:

glactools usepopsrootanc file1.acf.gz chimp ChimpHumanAncestor > file3.acf.gz

file3.acf.gz will look like this:

#ACF
#PG:usepopsrootanc /tmp/temp.acf.gz chimp ChimpHumanAncestor 
#GITVERSION: 9d3e4107ea445a16737fb841e2181dabf31acac9
#DATE: 2020-04-02
#USEPOPASROOTANC: chimp chimp
#USEPOPASROOTANC#1
#	#ACF
#	#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz 
#	#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574
#	#DATE: 2019-12-02
#	#chr	coord	REF,ALT	root	anc	chimp	ChimpHumanAncestor
#SQ	SN:1	LN:249250621
#SQ	SN:2	LN:243199373
#chr	coord	REF,ALT	root	anc
2	100022	A,N	1,0:0	1,0:0
2	100023	G,N	1,0:0	1,0:0
2	100024	A,N	1,0:0	1,0:0
2	100025	C,N	1,0:0	1,0:0
2	100026	A,N	1,0:0	1,0:0
2	100027	G,N	1,0:0	1,0:0
2	100028	A,N	1,0:0	1,0:0
2	100029	A,N	1,0:0	1,0:0
2	100030	C,N	1,0:0	1,0:0
2	100031	T,N	1,0:0	1,0:0
2	100032	T,N	1,0:0	1,0:0
2	100033	C,N	1,0:0	1,0:0
2	100034	A,N	1,0:0	1,0:0
2	100035	T,N	1,0:0	1,0:0
2	100036	T,N	1,0:0	1,0:0
2	100037	G,N	1,0:0	1,0:0

Then you can use "replaceanc" to put the ancestral information into file2:

glactools replaceanc file2.acf.gz file3.acf.gz > file4.acf.gz

file4 should contain the same information as file to accept with the ancestral information of file1:

#ACF
#PG:replaceanc /tmp/temp2.acf.gz /tmp/file3.acf.gz 
#GITVERSION: 9d3e4107ea445a16737fb841e2181dabf31acac9
#DATE: 2020-04-02
#REPLACEANC:
#REPLACEANC#1
#	#ACF
#	#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz 
#	#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574
#	#DATE: 2019-12-02
#	#chr	coord	REF,ALT	root	anc	AltaiNean	Denisova	FrenchB	YorubaB	AustralianB
#REPLACEANC#2
#	#ACF
#	#PG:usepopsrootanc /tmp/temp.acf.gz chimp ChimpHumanAncestor 
#	#GITVERSION: 9d3e4107ea445a16737fb841e2181dabf31acac9
#	#DATE: 2020-04-02
#	#USEPOPASROOTANC: chimp chimp
#	#USEPOPASROOTANC#1
#	#	#ACF
#	#	#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz 
#	#	#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574
#	#	#DATE: 2019-12-02
#	#	#chr	coord	REF,ALT	root	anc	chimp	ChimpHumanAncestor
#	#chr	coord	REF,ALT	root	anc
#SQ	SN:1	LN:249250621
#SQ	SN:2	LN:243199373
#chr	coord	REF,ALT	root	anc	AltaiNean	Denisova	FrenchB	YorubaB	AustralianB
2	100022	A,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100023	G,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100024	A,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100025	C,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100026	A,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100027	G,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100028	A,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100029	A,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100030	C,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100031	T,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100032	T,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100033	C,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100034	A,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100035	T,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100036	T,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0
2	100037	G,N	1,0:0	1,0:0	2,0:0	2,0:0	2,0:0	2,0:0	2,0:0

In this case I have created two superfluous files, depending on your level of comfort with Unix file descriptors, you can do the same process without creating intermediate files.

Hope this answers your questions, should I add this to the readme? let me know if I can close this issue.

@grenaud
Copy link
Owner

grenaud commented Apr 9, 2020

Is this fine? Can I close the issue?

@congzhouczcz
Copy link
Author

Thank you very much, grenaud. I get it and now it works.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants