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

Is there a way to change the directory to the fragment file? #206

Closed
chent5 opened this issue Aug 21, 2020 · 5 comments
Closed

Is there a way to change the directory to the fragment file? #206

chent5 opened this issue Aug 21, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@chent5
Copy link

chent5 commented Aug 21, 2020

I have generate a signac object using the newest Signac version. After that, one folder associated with the directory to the fragment file has to be renamed. Is there a way to only change the directory to the fragment file for the signac object? Thank you so much!

@timoast
Copy link
Collaborator

timoast commented Aug 21, 2020

Currently there is not any way to change the fragment file path (I could add this in the future). For now you should remove the old fragment object and replace it with a new one with the correct path (https://satijalab.org/signac/articles/data_structures.html#the-fragment-class)

@timoast timoast added the enhancement New feature or request label Aug 21, 2020
@chent5
Copy link
Author

chent5 commented Aug 21, 2020

Thanks a lot for your prompt response. The above link shows how to add a fragment object to a chromatin assay. Could you please show me how to remove the old fragment object?

@timoast
Copy link
Collaborator

timoast commented Aug 21, 2020

You should be able to do it using:

tmp <- Fragments(object)
tmp[[<index_to_remove>]] <- NULL
object <- SetAssayData(object, slot = "fragments", new.data = tmp)

I'll try to add a function to do this in one step for the next release

@chent5
Copy link
Author

chent5 commented Aug 21, 2020

Thank you so much!

timoast added a commit that referenced this issue Sep 2, 2020
@timoast
Copy link
Collaborator

timoast commented Sep 2, 2020

Added UpdatePath() function and the ability to remove fragment objects by assigning NULL (eg, Fragments(object) <- NULL). This is available on the develop branch and will be added to the documentation on the website in the next release

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

No branches or pull requests

2 participants