Giter Site home page Giter Site logo

neuro_morpho_toolbox's People

Contributors

pengxie-bioinfo avatar zijun-zhao avatar zzhmark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

neuro_morpho_toolbox's Issues

igraph-->jgraph

今天我在给这个工具包装环境。在装到igraph的时候跳出来一个deprecationWarning,说是这个包的名称已经更改为jgraph了。我们的代码里是不是要变一下。

DeprecationWarning: To avoid name collision with the igraph project, this visualization library has been renamed to 'jgraph'. Please upgrade when convenient.

brain_structure的初始化中变量dict_to_selected结果异常

源码:

def __init__(self, input_file):
       # Read table
       MAXSIZE = 100
       my_cols = [i for i in range(MAXSIZE)]
       df = pd.read_csv(input_file, names=my_cols, engine='python',
                        skiprows=[0],
                        index_col=[1],
                        skipinitialspace=True)
       df = df.drop([0, 3, 4, 5, 6, 7, 8], axis=1)
       for i in range(df.shape[0]):
           for j in range(df.shape[1]):
               if df.iloc[i, j] is None:
                   df.iloc[i, j] = np.nan
       df.columns = ["Abbrevation"] + [i for i in range(1, df.shape[1])]
       df_isnull = df.isnull()

       # Get levels of each row
       level = []
       description = []
       for i in range(len(df)):
           for j in range(1, df.shape[1]):
               if not df_isnull.iloc[i, j]:
                   level.append(j)
                   description.append(df.iloc[i, j])
                   break
       MAXLEVEL = np.max(level)
       level = pd.DataFrame({'level': level, 'Abbrevation': df.Abbrevation.tolist(), 'Description': description},
                            index=df.index)

       # Drop redundant columns
       df = df.iloc[:, :(MAXLEVEL + 2)]  # The last column will contain only NaN
       df_isnull = df.isnull()

       # Fill empty slots in the table
       df_fill = df.copy()
       for i in range(1, df.shape[1]):
           cur_region = None
           for j in range(df.shape[0]):
               if not df_isnull.iloc[j, i]:
                   cur_region = df.iloc[j, i]
                   cur_level = level.loc[df.index[j], 'level']
                   # print(j, cur_region, cur_level)
               elif (not cur_region is None) & (cur_level < level.loc[df.index[j], 'level']):
                   df_fill.iloc[j, i] = cur_region

       self.input_file = input_file
       self.df = df_fill
       self.level = level
       self.selected_regions = self.df.index.tolist()
       self.dict_to_selected = {}
       for cur_region in self.selected_regions:
           child_ids = self.get_all_child_id(cur_region)
           for i in child_ids:
               self.dict_to_selected[i] = cur_region
       return

其中self.dict_to_selected初始化后结果是(用Mouse.csv文件):
image
这个变量是不是用来返回父亲节点的?这个现象是不是因为get_all_child_id会返回自己?

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.