Giter Site home page Giter Site logo

Point and click mode about chromosight HOT 8 CLOSED

ysora avatar ysora commented on August 16, 2024
Point and click mode

from chromosight.

Comments (8)

ysora avatar ysora commented on August 16, 2024 1

Thanks, chromosome selection took also long time but finally worked!
Also, thank you for suggesting another solution.

from chromosight.

cmdoret avatar cmdoret commented on August 16, 2024

Hi,

Indeed, this point and click mode is pretty memory heavy with large genomes, but your usage is correct.
One of the advice would be to use a lower resolution to reduce the size of the matrix, but I realize this is often not desirable.

I have just released a patch (v0.6.0) with an additional --chroms option which allows you to specify a list of chromosomes. When you use it in point and click mode, it will load each submatrix sequentially, and use much less memory. If you are also interested in interchromosomal contacts, you can also add the --inter flag. Example usage would be:

chromosight generate-config --click sample.cool --chroms chrom3,chrom5,chrom20 my_config

I'm happy to take any feedback or suggestion :)

Another solution would be to use an agglomerated matrix you generated with another method (e.g. using something like coolpup.py or custom scripts. You could even use a theoretical pattern, here is an example snippet to generate a basic stripe pattern:

import numpy as np
pattern_mat = np.zeros((17, 17))
pattern_mat[8, :] = 1.0
np.savetxt('pattern_stripe.txt', pattern_mat)

Then you could edit the "kernels" entry of your json config file to match the file name:

    "kernels": [
        "pattern_stripe.txt"
    ],

If you find a kernel that works well for your pattern, we would be happy to add it to the list of preconfigured kernels.

from chromosight.

cmdoret avatar cmdoret commented on August 16, 2024

Glad to know it worked !

In case that can be helpful, I have added two experimental kernel configurations stripes_left and stripes_right.
You should be able to use them by updating chromosight to v1.6.1 via pip.

Cheers,

from chromosight.

ysora avatar ysora commented on August 16, 2024

Great, thanks.
I will try and let you know the result.

from chromosight.

ysora avatar ysora commented on August 16, 2024

I tested it and found it works well. I have one question. What does the location of each dot mean? Is it marking the end of stripe?
Thanks.

from chromosight.

cmdoret avatar cmdoret commented on August 16, 2024

With stripes, the dots themselves do not have much meaning unfortunately. A dot represents a region of the matrix that looks especially like a stripe. Most of the time, there will be many dots aligned on a single stripe.

After detecting stripes_left, here is one way you could extract stripes from dots:

import pandas as pd
from chromosight.utils.detection import remove_neighbours
df = pd.read_csv('stripes_left.tsv', sep='\t')
# stripes_left positions are defined by bin1, but bin2 is arbitrary.
# We set bin2 to bin1 so that stripes dots are on the diagonal at the base of the stripe
df[ 'bin2'] = df['bin1'].copy()
# Filter out dots too close to another dot with a higher score
keep_mask = remove_neighbours(df, win_size=4)
# In the filtered dataframe, chrom1, start1, end1 and bin1 give coordinates of the left stripes
df = df.loc[keep_mask, ]

With stripes_left, points on the same stripe are aligned on the bin1 axis.
With stripes_right, they're aligned on the bin2 axis. So for right_stripes, coordinates of axis 2 are relevant and bin1 should be set to bin2 values.

from chromosight.

ysora avatar ysora commented on August 16, 2024

Thank you for your kind explanation!

from chromosight.

cmdoret avatar cmdoret commented on August 16, 2024

I'll be closing this for now but feel free to reopen if needed

from chromosight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.